Esempio n. 1
0
 void BroadcastCollisionExit(RagdollBone bone, Collision collision)
 {
     if (onCollisionExit != null)
     {
         onCollisionExit(bone, collision);
     }
 }
Esempio n. 2
0
 /*
  *      send the message out that bone was collided
  *      (given to ragdollbone component)
  */
 void BroadcastCollisionEnter(RagdollBone bone, Collision collision)
 {
     if (onCollisionEnter != null)
     {
         onCollisionEnter(bone, collision);
     }
 }
Esempio n. 3
0
 void BroadcastCollisionStay(RagdollBone bone, Collision collision)
 {
     if (onCollisionStay != null)
     {
         onCollisionStay(bone, collision);
     }
 }
Esempio n. 4
0
        public RagdollTransform(Transform transform, bool isBoneParent, bool isBone, bool isRoot)
        {
            this.transform = transform;

            // originalRotation = transform.localRotation;
            // originalPosition = transform.localPosition;

            this.isBoneParent = isBoneParent;
            this.isRoot       = isRoot;
            this.isBone       = isBone;

            bone      = transform.GetComponent <RagdollBone>();
            rigidbody = transform.GetComponent <Rigidbody>();
            if (rigidbody != null)
            {
                collisionDetectionModeBeforeKinematic = rigidbody.collisionDetectionMode;
            }
            collider = transform.GetComponent <Collider>();
            if (!isRoot)
            {
                joint = transform.GetComponent <ConfigurableJoint>();
                if (joint != null)
                {
                    connectedBody = joint.connectedBody;
                }
            }
        }