private void setTop(Desire newTop) { if (topPriority != null) { if (topPriority == newTop) { return; } try { topPriority.executeExit(); } catch (Exception e) { Debug.LogError("Exception of type " + e.GetType() + " caught in " + topPriority.name + " priority.executeExit"); } } topPriority = newTop; try { if (topPriority != null) { assertParent(topPriority); topPriority.executeEnter(); } } catch (Exception e) { Debug.LogError("'" + e.Message + "' caught in " + topPriority.name + " priority.executeEnter"); } }