/// <summary> /// Triggers this node within the graph. /// </summary> public virtual void TriggerNode() { TraversableGraph traversableGraph = (TraversableGraph)graph; if (traversableGraph != null) { traversableGraph.CurrentNode = this; } traversableGraph.SignalNodeTriggered(); #if UNITY_EDITOR EditorWindow.GetWindow <NodeEditorWindow>("xNode", false)?.Repaint(); #endif }
/// <inheritdoc /> public override void TraverseToNextNode() { TraversableGraph traversableGraph = (TraversableGraph)graph; TraversableNode exit = GetConnectedNode("Exit"); if (exit != null) { exit.TriggerNode(); } else { traversableGraph.SignalEndReached(); } }
/// <inheritdoc /> public override void TraverseToNextNode() { TraversableGraph traversableGraph = (TraversableGraph)graph; for (int i = 0; i < Conditions.Count; i++) { ConditionalEventSet condition = Conditions[i]; if (condition.Evaluate()) { TraversableNode evaluatedCondition = GetConnectedNode($"{nameof(Conditions)} {i}"); if (evaluatedCondition != null) { evaluatedCondition.TriggerNode(); } else { traversableGraph.SignalEndReached(); } return; } } TraversableNode defaultNode = GetConnectedNode("Default"); if (defaultNode != null) { defaultNode.TriggerNode(); } else { traversableGraph.SignalEndReached(); } }