/// <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
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
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
public abstract EnemyState Update(EnemyStateMachine enemy); // creates a special update that can be taken over by other classes