Nodes
using FlowReactor.Nodes
public virtual void Init(Graph _graph, Node _node)
Called when node is created in a graph
public virtual void OnExecute(FlowReactorComponent _flowReactor){}
Called when node is being executed. This is where your custom code belongs to when creating custom nodes.
Parameters | Description |
---|---|
FlowReactorComponent | The actual FlowReactor component which executes this graph in the scene |
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.
Parameters | Description |
---|---|
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);
public virtual void OnNodeDisable(FlowReactorComponent _flowReactor){}
Called by FlowReactorComponent OnDisable
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
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.
public virtual void OnUpdate(FlowReactorComponent _flowReactor)
Similar to the Monobehaviour Update method. Gets called on every frame.
public virtual void OnLateUpdate(FlowReactorComponent _flowReactor)
Similar to the Monobehaviour LateUpdate method.
public virtual void OnFixedUpdate(FlowReactorComponent _flowReactor)
Similar to the Monobehaviour FixedUpdate method.
public virtual void OnApplicationExit(FlowReactorComponent _flowReactor)
Gets called on application quit
public virtual void OnSelect(Graph _graph)
Editor method which gets called when the node has been selected.
public virtual void OnDelete()
Editor method. Gets called when node gets deleted
public virtual void DrawCustomInspector()
Override this method to create custom node inspector GUIs
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 modified 4mo ago