예제 #1
0
    public void ForceRelease()
    {
        HandGrabber grabber = grabbedBy.GetComponent <HandGrabber>();

        if (grabber != null)
        {
            grabber.ForceRelease();
        }
        base.OnDestroy();
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        storedLocalPosition = transform.localPosition;
        originalParent      = transform.parent;
        startsLeft          = isLeft(thigh.position.XY(), transform.position.XY(), knee.position.XY());
        if (movementLimits != null)
        {
            startingLimitSides = new List <bool>();
            foreach (Transform t in movementLimits)
            {
                startingLimitSides.Add(isLeft(t.position.XY(), t.position.XY() + t.right.XY(), t.position.XY()));
            }
        }
        if (!arms) // if these are the legs , set the default bool of what side of the line the legs are on for lift up limit;
        {
            legsStartLeft = isLeft(maxLegs.position.XY(), maxLegs.position.XY() + maxLegs.right.XY(), transform.position.XY());
        }

        moving  = arms;
        grabber = transform.GetComponent <HandGrabber>();
        closer  = transform.GetComponentInChildren <HandCloser>();
        CheckHighlights();
    }