コード例 #1
0
ファイル: GrabbableHands.cs プロジェクト: shafy/kosmos-school
        /// <summary>
        /// Notifies the object that it has been grabbed.
        /// </summary>
        virtual public void GrabBegin(GrabberHands hand, Collider grabPoint)
        {
            m_grabbedBy       = hand;
            m_grabbedCollider = grabPoint;
            gameObject.GetComponent <Rigidbody>().isKinematic = true;

            //Physics.IgnoreCollision(playerCollider, GetComponent<Collider>(), true);

            if (placerTrigger)
            {
                placerTrigger.ShowIndicators(true);
            }
        }
コード例 #2
0
ファイル: GrabbableHands.cs プロジェクト: shafy/kosmos-school
        /// <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;

            //Physics.IgnoreCollision(playerCollider, GetComponent<Collider>(), false);

            if (placerTrigger)
            {
                placerTrigger.ShowIndicators(false);
            }
        }
コード例 #3
0
 private void Awake()
 {
     m_grabber = GetComponent <GrabberHands>();
 }