Example #1
0
        private float AgentSpeed()
        {
            if (InputConfig.Run() && isMoving)
            {
                staminaComponent.ConsumeStamina(staminaCost);
            }
            float speed = isRunning ? agent.runSpeed : agent.walkSpeed;

            return(speed);
        }
        public override void FrameFeed()
        {
            if (moveComponent == null || staminaComponent == null)
            {
                moveComponent    = agent.RequestComponent <CharacterMovementComponent>();
                staminaComponent = agent.RequestComponent <CharacterStaminaComponent>();
                return;
            }

            if (InputConfig.Dash() && CanDash && moveComponent.isMoving)
            {
                staminaComponent.ConsumeStamina(agent.dashStaminaCost);
                agent.ChangeState <CharacterDashState>();
            }
        }