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); } }
public MovementController(BaseCharacterBehaviour character) { _character = character; _character.CurrentSpeed = _character.MoveSpeed.x; }
public State(ICharacter character) { this._character = (BaseCharacterBehaviour)character; }
private static void IdleState(BaseCharacterBehaviour character) { character.SetState(new IdleState(character)); }