public void IsAttacking(bool IsAttacking) { if (IsAttacking) { PlayerControllerStateMachine.Fighting(this); } else { PlayerControllerStateMachine.Patrolling(this); } }
private protected override void Start() { base.Start(); PlayerPresenter = (PlayerPresenter)CharacterPresenter; joystick = PlayerPresenter.PlayerUIPresenter.PlayerJoystick; attackButton = PlayerPresenter.PlayerUIPresenter.PlayerAttackButton; attackButton.OnPressingAttackButton += IsAttacking; PlayerStatePatrolling = GetComponent <PlayerStatePatrolling>(); PlayerStateFighting = GetComponent <PlayerStateFighting>(); PlayerControllerStateMachine = PlayerStatePatrolling; PlayerControllerStateMachine.Patrolling(this); }