Ejemplo n.º 1
0
        protected override bool SetMovementState(CMovState value)
        {
            var oldValue = this._currentMovState;

            if (!base.SetMovementState(value))
            {
                return(false);
            }

            // sliding
            if (value == CMovState.Sliding)
            {
                // is sliding now
                this._slideBeginTime = Time.time;
            }
            else if (oldValue == CMovState.Sliding)
            {
                // was sliding
                if (Time.time >= this._slideBeginTime + this._slideTimeToStumble)
                {
                    if (this._animator)
                    {
                        this._animator.SetTrigger(this.ANIM_CHAR_STUMBLE);
                    }
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Set Movement State Enum.
        /// </summary>
        /// <returns>Returns if the movement enum was set.</returns>
        protected virtual bool SetMovementState(CMovState value)
        {
            if (this._currentMovState == value)
            {
                return(false);
            }
            this._currentMovState = value;

            // set animators
            if (this._animator)
            {
                this._animator.CSetBoolSafe(this.ANIM_CHAR_IS_WALKING, value == CMovState.Walking);
                this._animator.CSetBoolSafe(this.ANIM_CHAR_IS_RUNNING, value == CMovState.Running);
                this._animator.CSetBoolSafe(this.ANIM_CHAR_IS_SPRINTING, value == CMovState.Sprint);
                this._animator.CSetBoolSafe(this.ANIM_CHAR_IS_SLIDING, value == CMovState.Sliding);
            }

            return(true);
        }
Ejemplo n.º 3
0
 public static bool IsMoving(this CMovState movState)
 {
     return(movState > CMovState.Idle);
 }
Ejemplo n.º 4
0
 public static bool IsMovingFast(this CMovState movState)
 {
     return(movState > CMovState.Walking);
 }