Unity plug-in playmaker call template, traverse array

Source: Internet
Author: User

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.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.