Esempio n. 1
0
    /// <summary>
    /// Notifies the object that it has been grabbed.
    /// </summary>
    virtual public void GrabBegin(OVRGrabber hand, Collider grabPoint)
    {
        m_grabbedBy       = hand;
        m_grabbedCollider = grabPoint;
        gameObject.GetComponent <Rigidbody>().isKinematic = true;

        RecursiveLayerSet.SetLayerRecursively(gameObject, hand.gameObject.layer);
    }
Esempio n. 2
0
    /// <summary>
    /// Notifies the object that it has been released.
    /// </summary>
    virtual public void GrabEnd(Vector3 linearVelocity, Vector3 angularVelocity)
    {
        Rigidbody rb = gameObject.GetComponent <Rigidbody>();

        rb.isKinematic     = m_grabbedKinematic;
        rb.velocity        = linearVelocity;
        rb.angularVelocity = angularVelocity;
        m_grabbedBy        = null;
        m_grabbedCollider  = null;

        RecursiveLayerSet.SetLayerRecursively(gameObject, iniLayer);
    }