public static void JumpState(BaseCharacterBehaviour character)
 {
     if (InputController.IsButtonYPressed())
     {
         character.SetState(new JumpState(character));
     }
 }
    /*
     * this script is mean to put everything that use the inputcontroller, so i only need to write it once and i can use it in other scripts
     * but it's not good enoug
     */

    public static void MoveState(BaseCharacterBehaviour character)
    {
        character.Movement = InputController.GetLeftJoystick();

        if (character.Movement != Vector3.zero)
        {
            character.SetState(new WalkState(character));
        }
        else
        {
            IdleState(character);
        }
    }
예제 #3
0
 public MovementController(BaseCharacterBehaviour character)
 {
     _character = character;
     _character.CurrentSpeed = _character.MoveSpeed.x;
 }
예제 #4
0
 public State(ICharacter character)
 {
     this._character = (BaseCharacterBehaviour)character;
 }
 private static void IdleState(BaseCharacterBehaviour character)
 {
     character.SetState(new IdleState(character));
 }