protected virtual void Update() { var nextAction = behaviorController.PopAction(); if (nextAction != null) { // change action Decide(nextAction); } else { // keep doing what we are already doing } }