public override void Update() { base.Update(); if (CurrentState != null) { CurrentState.Execute(); } }
/// <summary> /// 執行當前狀態 /// </summary> public void StateUpdate() { try { if (bcurrestState) { currestState.Execute(); } } catch (Exception e) { Debug.Log(e.Message); throw; } }
// Update is called once per frame void Update() { if (!IsDead()) { //Look at it's taget if he has one LookAtTarget(); //If he is not taking damage then he can execute his state. This makes it so that he stands still after taking damage if (!IsTakingDamage) { //Executes the current Ai state currentAIState.Execute(); } } else { Die(); } }