public void PlayAnimSpecial(AnimSpecials pAnimSpecial, bool pIsSpecial = true)
        {
            int InType = GAMEVAR.GetAnimSpecialType(pAnimSpecial);

            mStateManager.mAnimator.SetBool(GAMEVAR.special, pIsSpecial);
            mStateManager.mAnimator.SetInteger(GAMEVAR.specialType, InType);
            StartCoroutine(CloseSpecialOnAnim(0.4f));
        }
        private void HandleJump()
        {
            if (mStateManager._OnGround && mStateManager._CanJump)
            {
                if (mStateManager._JumpInput && !mStateManager._Jumping && mStateManager._OnLocomotion &&
                    mStateManager._CurrentState != StateManager.CharStates.E_Hold && mStateManager._CurrentState != StateManager.CharStates.E_OnAir)
                {
                    if (mStateManager._CurrentState == StateManager.CharStates.E_Idle)
                    {
                        mStateManager.mAnimator.SetBool(GAMEVAR.special, true);
                        mStateManager.mAnimator.SetInteger(GAMEVAR.specialType, GAMEVAR.GetAnimSpecialType(AnimSpecials.E_Jump_Idle));
                    }
                    if (mStateManager._CurrentState == StateManager.CharStates.E_Moving)
                    {
                        mStateManager.LegFront();
                        mStateManager._Jumping = true;
                        mStateManager.mAnimator.SetBool(GAMEVAR.special, true);
                        mStateManager.mAnimator.SetInteger(GAMEVAR.specialType, GAMEVAR.GetAnimSpecialType(AnimSpecials.E_Run_Jump));
                        mStateManager._CurrentState = StateManager.CharStates.E_Hold;
                        mStateManager.mAnimator.SetBool(GAMEVAR.onAir, true);
                        mStateManager._CanJump = false;
                    }
                }
            }

            if (mStateManager._Jumping)
            {
                if (mStateManager._OnGround)
                {
                    if (!mApplyJumpForce)
                    {
                        StartCoroutine(AddJumpForce(0));
                        mApplyJumpForce = true;
                    }
                }
                else
                {
                    mStateManager._Jumping = false;
                }
            }
        }
Example #3
0
        private void HandleRun()
        {
            bool InRunInput = Input.GetButton(GAMEVAR.Fire3);

            if (InRunInput)
            {
                mStateManager._Walk = false;
                mStateManager._Run  = true;
            }
            else
            {
                mStateManager._Walk = true;
                mStateManager._Run  = false;
            }

            if (mHorizontal != 0 || mVertical != 0)
            {
                mStateManager._Run = InRunInput;
                mStateManager.mAnimator.SetInteger(GAMEVAR.specialType, GAMEVAR.GetAnimSpecialType(AnimSpecials.E_Run));
            }
            else
            {
                if (mStateManager._Run)
                {
                    mStateManager._Run = false;
                }
            }
            if (!mStateManager._InAngleMoveDirection && mMovementHandler._DoAngleCheck)
            {
                mStateManager._Run = false;
            }
            if (mStateManager._ObstacleForward)
            {
                mStateManager._Run = false;
            }
            if (mStateManager._Run == false)
            {
                mStateManager.mAnimator.SetInteger(GAMEVAR.specialType, GAMEVAR.GetAnimSpecialType(AnimSpecials.E_RunToStop));
            }
        }