PlayMaker

States

The initial state is used to initialize (you can set the object into initial status).

It starts with the script’s launch.

Each state has its own list of action. To add an action, you should press button 6 (Action Browser).

State changes from one to another are done using the events.

Åvents

While sending an event you can select the Event Target: Broadcast All (as finite state machines that are on), to GameObject itself, or to GameObject and all of its sub-objects.

Sounds

AudioClip can be played by setting any GameObject where the audio source is present.

To switch the state when the sound is over, select the event in “Finished Event” field.

Scripts (on the fade example)

To create a script with the possibility to copy and paste, let’s create a variable with a link to the script:

  1. Create a variable with Type Object.

  2. Select script type (Assets - Scripts - Script - Fade).

  3. Get it into variable.

  4. Create global events FadeIn and FadeOut.

  5. Add to Init state the switch of two events (FadeIn, FadeOut) and return back.

  6. Using the variable, set the properties and launch the script.

Event properties

While sending the event, you can set some Event Data:

Depending on the data, you can get it and set the needed values, e.g. in Vector3, we send start (X), end (Y), time (Z) values for Fade.

To get the sent data, use action “Get Event Vector3 Data”.

See additional information about PlayMaker here - hutonggames.fogbugz.com