Unity Plugin (UP) & API
What are Custom Variables?
Custom Variables are used to define variables that you and your team can use in all diagrams, by referencing them in the Formula fields of Nodes and Connections.
There are 3 tabs available:
- Diagram – a list of variables in use on the diagram you are currently editing
- Private – all variables available across your account
- Team – all variables available across your team’s account
To use a private or team variable in your diagram, it must be added to the Diagram tab first.
Read the following sections for more details.
- Click the + button as shown in the screenshot above
- Pick the type of variable you’d like to add from the dropdown
- Go through the configuration steps
Custom Variables added by using the + button while in the Diagram tab:
- will be readily available for use in the diagram you’re currently editing
- will also be listed in the Private tab
Custom Variables added by using the + button while in the Private/Team tabs
- will not be available in the Diagram tab upon saving
- to use them in the diagram you are currently editing, go through the section below: Using a previously saved variable
To add a custom variable you or a teammate have previously defined and saved:
- Go to the Private or Team tab
- Find the custom variable you wish to use
- Click the contextual menu (3-dotted) next to it
- Choose between:
- Use in this diagram – an instance of this custom variable will be available in the Diagram tab, and you can use it in the Formula fields of nodes and connections. Changes made to a custom variable added through this method will propagate throughout ALL its instances.
- Copy to this diagram – a copy of this custom variable will be made available in the Diagram tab and you can use it in the Formula fields of nodes and connections. Use this method if you want the custom variable to be independent of the one being copied. Changes made to the custom variable being copied will NOT affect its copies.
There are 4 types of custom variables you can define:
- Randomness – acts as a random number generator and can be defined as intervals or arrays
- Math Expression – define complex variables using formulas from the math.js library
- External JSON – uses input values from external JSON files
- Live Market Feeds – returns stats (e.g. FloorPrice) for projects listed on markets
If any of your older diagrams used the now deprecated Global Variables (Dice, Skill, Multiplayer, Strategy) feature, we will automatically create a custom variable with the same set-up as you defined in the deprecated feature.
This ensures that your older diagrams will still work as intended.