private void FixedUpdate() { if (aiEnabled) { StartCoroutine(behavior.AIUpdate()); currentBstate = behavior.GetState(); } }
private IEnumerator AIUpdate() { while (aiEnabled) { behavior.AIUpdate(); currentBstate = behavior.GetState(); yield return(new WaitForSeconds(1f)); } }