/// <summary>
 /// Overrides the enemy's update function to use
 /// </summary>
 /// <param name="enemy"> stores a reference of the EnemyStateMachine in enemy</param>
 /// <returns>nothing because the enemy is dead</returns>
 public override EnemyState Update(EnemyStateMachine enemy)
 {
     //Debug.Log("boom"); 
     enemy.Explode(); // tells the enemy to explode(destroy itself)
     return null; // stay in this state
 } // end update
Example #2
0
        public abstract EnemyState Update(EnemyStateMachine enemy); // creates a special update that can be taken over by other classes

        public virtual void OnStart(EnemyStateMachine enemy) { } // a start function that can be taken over by other classes
Example #3
0
 public virtual void OnStart(EnemyStateMachine enemy) { } // a start function that can be taken over by other classes
 public virtual void OnEnd(EnemyStateMachine enemy) { } // a end function that can be taken over by other classes
Example #4
0
 public abstract EnemyState Update(EnemyStateMachine enemy); // creates a special update that can be taken over by other classes