/// <summary> /// Switch the current behavior /// </summary> /// <param name="next">Behavior to switch to</param> public void SwitchState(State next) { switch (next) { case (State.ATTACK): StartCoroutine(attack.Attack()); break; case (State.SEEK): StartCoroutine(seek.Seek()); break; } }
/// <summary> /// Switch the current behavior /// </summary> /// <param name="next">Behavior to switch to</param> public void SwitchState(State next) { switch (next) { case (State.ATTACK): Debug.Log(gameObject.name + " is attacking."); StartCoroutine(attack.Attack()); break; case (State.SEEK): Debug.Log(gameObject.name + " is seeking."); StartCoroutine(seek.Seek()); break; } }