public override void Execute() { State = (condition.IsTrue()) ? eState.ConditionTrue : eState.ConditionFalse; DecisionNode node = (State == eState.ConditionTrue) ? trueNode : falseNode; node?.Execute(); }
void Update() { DecisionNode[] nodes = FindObjectsOfType <DecisionNode>(); foreach (var node in nodes) { node.State = DecisionNode.eState.Inactive; } root.Execute(); }