Playmaker's invocation template can be used as a function, which reduces the amount of development and makes the structure clearer.
Invoke template
The key to invoking the template is the run FSM action, which selects the template to invoke in the action, or you can create a new template here.
Inside the template, parameters can be obtained from the Get FSM XXX action, and the FSM name and variable name are the same as those in the outside call state machine.
Gets the parameter assigned to the local variable, and then it can be used.
The return parameter is implemented with the Set FSM XXX action, which requires the same parameters as the fetch parameter.
In addition, be sure to add the finish FSM action, otherwise it will stop in the template can not continue to run.
Run, the template gets the string content "input string", which is modified to "get new string" and returns.
Iterating through an array
The method of using an array is actually invoking the template for processing.
Build variable of array type, playmaker variable type is quite a lot of
Create an array and a temporary variable to store the specific objects in the array
Using the array for each action, invoke the foreach template, putting each object traversed into the instring variable
The template also uses the Get FSM XXX action to obtain specific objects, and then processing. Remember to add the finish FSM action.
Run it and correctly output the values in the template.