Ejemplo n.º 1
0
    private void MoveKnobToHand(Knob knob)
    {
        if (knob != null)
        {
            float tolerance = 0.01f;

            Vector3 handPosition = grab.hand.Centre();

            Debug.Log("hand z: " + handPosition.z);
            Debug.Log("knob z: " + knob.Z());

            if (handPosition.z < (knob.Z() - tolerance))
            {
                knobs.MoveCloser();
            }
            else if (handPosition.z > (knob.Z() + tolerance))
            {
                knobs.MoveAway();
            }
        }
    }