コード例 #1
0
        protected void CheckReset(Collider other)
        {
            SG_Grabable grabable = other.gameObject.GetComponent <SG_Grabable>();

            if (other.tag.Contains(this.resetTag) && grabable != null && !grabable.IsInteracting())
            {
                grabable.ResetObject();
                //Debug.Log("Reset " + other.name);
            }
        }
コード例 #2
0
        //--------------------------------------------------------------------------------------------------------------------------
        // Functions

        /// <summary> Check if you can reset a collider. </summary>
        /// <param name="other"></param>
        protected void CheckReset(Collider other)
        {
            SG_Grabable grabable = other.gameObject.GetComponent <SG_Grabable>();

            if (grabable == null && other.attachedRigidbody != null)
            {
                grabable = other.attachedRigidbody.GetComponent <SG_Grabable>();
            }
            if (grabable != null && !grabable.IsInteracting() && other.tag.Contains(this.resetTag))
            {
                grabable.ResetObject();
            }
        }