FRNodeControllable
Last updated
Last updated
// Namespace
using FlowReactor.Nodes.Modules
public class ControllableExample : MonoBehaviour, INodeControllable
{
// Gets called on node initialization
public void OnNodeInitialize(Node _node)
{
Debug.Log("On Initialization");
}
// Gets called on node execution
public void OnNodeExecute()
{
Debug.Log("On Execute");
}
// Gets called on node stop execution
public void OnNodeStopExecute()
{
Debug.Log("On Stop Execute");
}
// Method for manual controllable method calls
// This requires that the node which has the FRControllableModule to
// call the method: CallOnNode(_flowRector, this, null);
public void OnNode(Node _node, object[] _parameters){}
}
//using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using FlowReactor;
namespace FlowReactor.Nodes.Modules
{
public interface INodeControllable
{
// Automatically called on node initialization
void OnNodeInitialize(Node _node);
// Automatically called on node execution
void OnNodeExecute();
// Automatically called on node stop execution
void OnNodeStopExecute();
// Method for manual controllable method calls
void OnNode(Node _node, params object[] _parameters);
}
}
//// Namespace
using FlowReactor.Nodes.Modules;
// Create new instance of type FRNodeControllable
FRNodeControllable moduleNodeControllable = new FRNodeControllable();
//
FRNodeControllable moduleNodeControllable = new FRNodeControllable();
// Call OnInitialize method manually
moduleNodeControllable.CallInitializeNode(_flowRector, this);
// Call OnNodeExecute method manually
moduleNodeControllable.CallStartExecuteNode(_flowRector, this);
// Call OnNodeStopExecute method manually
moduleNodeControllable.CallStopExecuteNode(_flowRector, this);
// Call OnNode method manually
moduleNodeControllable.CallOnNode(_flowRector, this, null);
//