private void GetNewAction() { if (actionBuffer.Count > 0) { currentAction = actionBuffer.Dequeue(); return; } foreach (BehaviourTree item in root.Act()) { actionBuffer.Enqueue(item as Action); } }