Example #1
0
    public override void Execute()
    {
        State = (condition.IsTrue()) ? eState.ConditionTrue : eState.ConditionFalse;

        DecisionNode node = (State == eState.ConditionTrue) ? trueNode : falseNode;

        node?.Execute();
    }
Example #2
0
    void Update()
    {
        DecisionNode[] nodes = FindObjectsOfType <DecisionNode>();
        foreach (var node in nodes)
        {
            node.State = DecisionNode.eState.Inactive;
        }

        root.Execute();
    }