mirror of
https://github.com/nothke/quality-control.git
synced 2025-08-08 23:03:43 +00:00
Fixing small bugs.
This commit is contained in:
@@ -52,8 +52,13 @@ public class CranePickDrop : MonoBehaviour
|
||||
if (state == State.Catching)
|
||||
{
|
||||
Debug.Assert(handlingBody, this);
|
||||
Debug.Assert(magnet, this);
|
||||
|
||||
if (handlingBody == null)
|
||||
{
|
||||
state = State.Idle;
|
||||
return;
|
||||
}
|
||||
|
||||
magnet.strength = magnetStrength;
|
||||
|
||||
if (magnet.IsCloseTo(handlingBody, 2f))
|
||||
|
@@ -6,6 +6,8 @@ public class HammerableRigidbody: RigidbodyInteractable
|
||||
{
|
||||
public override void Use(InteractionController im)
|
||||
{
|
||||
manager = im;
|
||||
|
||||
if (im.hands.item == null)
|
||||
{
|
||||
base.Use(im);
|
||||
|
@@ -15,6 +15,11 @@ public class Magnet : MonoBehaviour
|
||||
|
||||
if (otherRb && otherRb.isKinematic == false)
|
||||
{
|
||||
if (!otherRb.GetComponent<Product>())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Vector3 dir = otherRb.position - transform.position;
|
||||
float dirSq = Vector3.SqrMagnitude(dir);
|
||||
float forceMagnitude = strength * (1.0f / dirSq);
|
||||
|
Reference in New Issue
Block a user