Ejemplo n.º 1
0
        public override void Update()
        {
            base.Update();

            if (CurrentState != null)
            {
                CurrentState.Execute();
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 執行當前狀態
 /// </summary>
 public void StateUpdate()
 {
     try
     {
         if (bcurrestState)
         {
             currestState.Execute();
         }
     }
     catch (Exception e)
     {
         Debug.Log(e.Message);
         throw;
     }
 }
Ejemplo n.º 3
0
    // 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();
        }
    }