Nodes
Namespace
using FlowReactor.Nodes
Init
public virtual void Init(Graph _graph, Node _node)
Called when node is created in a graph
OnExecute
public virtual void OnExecute(FlowReactorComponent _flowReactor){}
Called when node is being executed. This is where your custom code belongs to when creating custom nodes.
FlowReactorComponent
The actual FlowReactor component which executes this graph in the scene
ExecuteNext
public void ExecuteNext(Enum _outputEnum, FlowReactorComponent _flowReactor)
public void ExecuteNext(int _output, FlowReactorComponent _flowReactor)
Execute the next node which is connected on the nodes output port.
Enum _outpuEnum
Pass the output port as an enum (see example below)
int _output
The output port index
FlowReactorComponent _flowReactor
The current FlowReactor component
Example
// Execute the next connected node with custom enum.
// Create custom enum
enum CustomOutputs
{
OutputA = 0,
OutputB = 1
}
// Execute next node with custom enum
ExecuteNext(CustomOutputs.OutputA, _flowreactor);
OnNodeDisable
public virtual void OnNodeDisable(FlowReactorComponent _flowReactor){}
Called by FlowReactorComponent OnDisable
OnInitialize
public virtual void OnInitialize(FlowReactorComponent _flowReactor)
Similar to the Monobehaviour Awake. Gets called on initialization on every node in all graphs and subgraphs. No matter if the sub-graph is currently active or not
OnGraphStart
public virtual void OnGraphStart(FlowReactorComponent _flowReactor)
OnGraphStart should be only used by the OnStart node. Unlike the OnInitialization, OnStart only gets called in the root graph and only if the graph is active.
OnUpdate
public virtual void OnUpdate(FlowReactorComponent _flowReactor)
Similar to the Monobehaviour Update method. Gets called on every frame.
OnLateUpdate
public virtual void OnLateUpdate(FlowReactorComponent _flowReactor)
Similar to the Monobehaviour LateUpdate method.
OnFixedUpdate
public virtual void OnFixedUpdate(FlowReactorComponent _flowReactor)
Similar to the Monobehaviour FixedUpdate method.
OnApplicationExit
public virtual void OnApplicationExit(FlowReactorComponent _flowReactor)
Gets called on application quit
OnSelect
public virtual void OnSelect(Graph _graph)
Editor method which gets called when the node has been selected.
OnDelete
public virtual void OnDelete()
Editor method. Gets called when node gets deleted
DrawCustomInspector
public virtual void DrawCustomInspector()
Override this method to create custom node inspector GUIs
DrawGUI
public virtual void DrawGUI(string _title, int _id, Graph _graph, GUISkin _editorSkin)
Draws the default node GUI. Override this method to add custom GUI Elements
Last updated