Creating a completely new/empty Macro can be done in two ways. Either through the “Add Node” context menu and under the “MACROS/Create New…” option, or by right clicking in the Unity project panel and selecting “Create/New/Macro”. In either case, a “Save As” window will pop up for you to select where to save the new macro asset file in your project.
Editing the newly created Macro can be done by either selecting it in the project panel, or simply double clicking the macro added in the flowscript, in which case it will open up inline to your flowscript. Every newly created Macro, will come with two very important nodes already created within, those being the Macro Input and the Macro Output nodes.
As they suggest, those two nodes are there to define all the input and outputs that the Macro has. Clicking on the Macro Input node, you are able through it’s node inspector to define the various input ports of the macro and similar it can also be done by clicking on the Macro Output node. In the following example, there are 4 different input ports defined. 2 Flow inputs called “Call” and “Break”, as well as 2 Value inputs one being of an integer and the other of a boolean type.
An alternative way of defining new macro ports, is to drag and drop another node’s port on top of either the Macro Input or Macro Output nodes, as illustrated bellow. You can do the same for output ports as well and you are free to rename the ports at a later time of course.
Another great way to create a Macro, is by converting any multiple selection of existing nodes, and into a Macro. Doing so, will automatically make the connections setup necessary and define the macro inputs and outputs.