示例#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;
            }
            if (limbsIK && enableCatchIK)
            {
                limbsIK.setIKDirection(false);
                limbsIK.OnReachZeroRH = () =>
                {
                    limbsIK.RHandIKEnabled = false;
                    limbsIK.OnReachZeroRH  = null;
                };
            }
            character.triggerRootMotion = false;
            character.disableMove       = false;
            character.enablePhysics();
            character.animator.SetBool(HashIDs.JumpOnBool, false);
        }
        /// <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;
            }

            // reset steps audio clips to character
            character.audioManager.ladderClips = null;
            character.triggerRootMotion        = false;
            character.disableMove = false;
            character.enablePhysics();
            if (GoingUp)
            {
                character.animator.SetBool(/*"pLadderUp"*/ HashIDs.LadderUpBool, false);
            }
            else
            {
                character.animator.SetBool(/*"pLadderDown"*/ HashIDs.LadderDownBool, false);
            }

            Vector3 right = character.transform.right;
            character.transform.up    = Vector3.up;
            character.transform.right = right;

            if (limbsIK)
            {
                limbsIK.handIKMode = IKMode.Default;
                limbsIK.feetIKMode = IKMode.Default;
                limbsIK.setIKDirection(false);

                limbsIK.OnReachZeroLH = () =>
                {
                    limbsIK.LHandIKEnabled = false;
                    limbsIK.OnReachZeroLH  = null;
                };
                limbsIK.OnReachZeroRH = () =>
                {
                    limbsIK.RHandIKEnabled = false;
                    limbsIK.OnReachZeroRH  = null;
                };
                limbsIK.LFootIKEnabled = false;
                limbsIK.RFootIKEnabled = false;
            }
        }
示例#3
0
        /// <summary>
        /// break from trigger matching target
        /// </summary>
        public void breakTrigger()
        {
#if DEBUG_INFO
            if (!m_initialized)
            {
                Debug.LogError("Component not initialized! " + " < " + this.ToString() + ">");
                return;
            }
#endif

            if (!enabled)
            {
                return;
            }
            m_Character.animator.InterruptMatchTarget();
            if (m_CurrentActiveTrigger)
            {
                m_CurrentActiveTrigger.end(m_Character, m_IKHelper);
            }

            m_Character.animator.SetBool(/*"pOnLedge"*/ HashIDs.OnLedgeBool, false);
            m_Character.animator.SetBool(/*"pGrabLedgeUp"*/ HashIDs.GrabLedgeUpBool, false);
            m_Character.animator.SetBool(/*"pGrabLedgeDown"*/ HashIDs.GrabLedgeDownBool, false);
            m_Character.animator.SetBool(/*"pGrabLedgeLeft"*/ HashIDs.GrabLedgeLeftBool, false);
            m_Character.animator.SetBool(/*"pGrabLedgeRight"*/ HashIDs.GrabLedgeRightBool, false);
            m_Character.animator.SetBool(/*"pLedgeHang"*/ HashIDs.LedgeHangBool, false);

            m_Character.jumpAllowed = true;
            m_Character.enablePhysics();
            m_Character.rigidBody.isKinematic = false;
            m_Character.setMoveMode(TPCharacter.MovingMode.RotateToDirection);
            m_Character.disableCapsuleScale = false;
            m_Character.restoreCapsuleSize();
            m_Character.disableMove        = false;
            m_Character.disableGroundCheck = false;
            m_Character.ledgeMove          = false;
            m_Character.animatorDampTime   = 0.1f;
            m_Character.setLedge(null);
            m_IKHelper.handIKMode = IKMode.Default;
            m_IKHelper.feetIKMode = IKMode.Default;

            m_TriggerAllowed = false;
            m_TriggerTime    = 0.0f;

            disableIK();
            m_TriggerActive = false;

            if (OnTriggerEnd != null)
            {
                OnTriggerEnd();
            }

            m_CurrentActiveTrigger = null;
        }
        /// <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.enablePhysics();
            character.animator.SetBool(/*"pJumpDown"*/HashIDs.JumpDownBool, false);
        }