Ejemplo n.º 1
0
        /// <summary>
        /// end trigger animations
        /// </summary>
        /// <param name="character">character interacting with trigger</param>
        /// <param name="limbsIK">ik helper</param>
        public override void end(TPCharacter character, IKHelper limbsIK)
        {
            if (!character)
            {
#if DEBUG_INFO
                Debug.LogError("object cannot be null!" + " < " + this.ToString() + ">");
#endif
                return;
            }
            if (!Target)
            {
#if DEBUG_INFO
                Debug.LogWarning("trigger target not assigned!" + " < " + this.ToString() + ">");
#endif
                return;
            }


            character.triggerRootMotion = false;
            character.disableMove       = false;
            character.setMoveMode(TPCharacter.MovingMode.Ledge);

            OrbitCameraController oc = character.GetComponentInChildren <OrbitCameraController>();
            if (oc)
            {
                oc.additiveRotation = true;
            }

            character.disableCapsuleScale = true;
            character.animator.SetBool(/*"pGrabLedgeUp"*/ HashIDs.GrabLedgeUpBool, false);
            character.animator.SetBool(/*"pOnLedge"*/ HashIDs.OnLedgeBool, true);
            character.animatorDampTime       = 0.0f;
            character.ledgeMove              = true;
            character.disableLedgeConstraint = false;
            character.fullStop();
            character.jumpAllowed = true;

            if (limbsIK)
            {
                limbsIK.RHandIKEnabled = true;
                limbsIK.LFootIKEnabled = true;
                limbsIK.RFootIKEnabled = true;
                limbsIK.LHandIKEnabled = true;
                limbsIK.LFWeightTime   = 0.0f;
                limbsIK.RFWeightTime   = 0.0f;

                limbsIK.startLedgeAdjust(m_TriggerInfo.targetRotation);
                limbsIK.checkHang = true;
            }
            if (character.animator.GetBool(/*"pLedgeHang"*/ HashIDs.LedgeHangBool))
            {
                character.restoreCapsuleSize();
            }
            else
            {
                character.scaleCapsuleToHalf();
            }
        }