Exemple #1
0
        private void Update()
        {
            if (ragdoll == null)
            {
                return;
            }

            // If the ragdoll is returned to the pool, stop tracking it.
            if (!ragdoll.isActiveAndEnabled)
            {
                ragdoll = null;
                return;
            }

            var focusPosition = ragdoll.CentreBone != null
                ? ragdoll.CentreBone.transform.position
                : ragdoll.transform.position;

            TurnToFace(focusPosition);
        }
 private void Awake()
 {
     ragdoll   = GetComponent <PoolableRagdoll>();
     gunSocket = GetComponent <GunSocket>();
 }
Exemple #3
0
 private void OnRespawn(Empty empty)
 {
     ragdoll = null;
     playerCamera.transform.localPosition = Vector3.zero;
     playerCamera.transform.localRotation = Quaternion.identity;
 }
Exemple #4
0
 private void SetRagdoll(GameObject ragdollObject)
 {
     ragdoll = ragdollObject.GetComponent <PoolableRagdoll>();
 }