public static Player_IdleState Instance() { if (_instance == null) { _instance = new Player_IdleState(); } return(_instance); }
void Awake() { IdleState = this.GetComponent <Player_IdleState>(); EmptyState = this.GetComponent <Player_EmptyState>(); CloseToLeaderState = this.GetComponent <Player_CloseToLeaderState>(); ListeningState = this.GetComponent <Player_ListeningState>(); HandClapingState = this.GetComponent <Player_HandClapingState>(); WalkingState = this.GetComponent <Player_WalkingState>(); SaluteState = this.GetComponent <Player_SaluteState>(); WaveHandState = this.GetComponent <Player_WaveHandState>(); ShakeHandsState = this.GetComponent <Player_ShakeHandsState>(); WaitingState = this.GetComponent <Player_WaitingState>(); }
public override void ExecuteState(Player owner) { if (!owner.IsAttacking) { owner.Attack(); alreadyAttacked = true; if (alreadyAttacked) { alreadyAttacked = false; owner.GetFSM().ChangeState(Player_IdleState.Instance()); } } }