-
Notifications
You must be signed in to change notification settings - Fork 34
Graph Functions
We have the ability to directly reference machines like classes, but graphs don't have functions built into their declaration. We can get around this by combining a Sub Graph/Super Unit, a Delegate, and the ability to reference machines as instances.
Simply create a graph variable. Any name is fine. It's beneficial to give some sort of indicator it's for a function, not a variable, we'll use an asterisk. The variables will always be null prior to entering Play Mode, so don't set the type.
Place an On Enable into Once and set the function variable to the Delegate Value Output port. This will allow for an easy setup phase, that only occurs one time.
The first time a value is retrieved from this port, it is initialized, setting up the wrapper instance. Therefore we must do this in the graph. That's it.
You will end up with variables that act like class functions.
THIS ENTRY IS UNDER CONSTRUCTION
- Overview
-
Unit Reference
- Control
- Editor
- Events
- Graphs
- Logic
- Time
- Variables
- C# Generation
- Editor Windows
- Graph Context
- Utilities
- Custom Unit Creation Guide
- Tips & Tricks