Sample graphs
Last updated
Last updated
The AFX package includes several sample AFX. You can use the examples to gain a better understanding of the available nodes and how to use them. You can also reuse and modify any of the example graphs.
We recommend that you create a copy of any graph that you want to use or modify, and use that copy instead of the original. The example graphs may be modified or removed in future versions of the AFX system.
The example AFX use similar design patterns. These are described in the following sections.
Where a variable component is used to create a reference that's shared by multiple graphs, that component is given its own game object.
This enables you to assign a meaningful name to the game object, and makes the relationships in the AFX easier to understand.
An AFX graph is active only when the game object that it's attached to is active. Therefore, you can control the activation of AFX graphs by activating and deactivating their parent game objects.
This approach removes the need to perform additional checks within a graph to determine whether or not it should run. Most example graphs are designed with the assumption that if they're active, then they should execute their task.
Most of the example AFX graphs are intended to perform a specific, simple task. The functionality of the AFX is then created through the combination of graphs. This makes graphs reusable and easier to understand.
To enable each graph to perform a specific task, they make extensive use of references. A graph can evaluates parameters in an environment, and then set the value of a reference. Another graph can read the value of a reference, and use that to determine how it performs a task.