Learn how to use FlowCanvas

External Node Implementation

Yet another way to create nodes (or in this case rather implement the functionality of a node), is to implement such functionality within your own code by implementing the IExternalImplementedNode interface. Doing this will basically wrap up any functionality you want your type to have with respect to FlowCanvas, into a node. Here is an example of this:

As you can see, the IExternalImplementedNode interface has only one method that needs implementation, that being the “RegisterPorts”. Registration here is the same as in Creating Full Nodes explained before, however doing it this way, you have direct access to all the methods, fields, properties etc of your type (which derives MonoBehaviour in this example) to get, set, call, or otherwise use!

When you drag and drop an instance of the “Example” MonoBehaviour we created above into a flowScript, on top of the usual options you will also be able to add the “Example” MonoBehaviour directly as an implemented node into the flowscript.

Yes No Suggest edit
3 of 3 users found this section helpful
Suggest Edit