CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
Action functions
Overview of the action functions
Actions provide other ways to control cues than simply playing them back.
It is possible to assign small events to a cue, so that almost all sound changes can be designed within the data itself, without requiring any extra programming.
adx2_keys_action_missile.png
[Examples of usage]
  • Cue 1 plays the sounds of the launch and flight of a missile. Cue 2 stops the sound of the flight and plays an impact sound.
  • Cue 1 plays the sound of a telephone ringing. Cue 2 stops the ringing sound and plays the sound of someone picking up the receiver.
  • When the game is paused, cue 1 muffles the music that is being played.
  • Cue 1 plays the sound of a flying helicopter. Cue 2 changes it so that it sounds like the helicopter moved behind a mountain.
  • Cue 1 plays the sound of the rotor of a helicopter. Cue 2 changes it so that it sounds like the helicopter is taking off.
  • Selector labels are configured so that footsteps sound different depending on the type of surface on which a character walks. Cue 1 changes the type of surface (i.e. the selector label).
  • Beat synchronization information is embedded in the music. Cue 1 switches the music while synchronizing with the beat.
    ...
Basically, an application does not need to know whether a cue uses actions or not.
However, it must know about it if controlling the scope of the actions (i.e. what objects are affected) is required.
To learn more about adding actions to cues, please refer to the tool manual.
Scope of an action
It is possible to specify the scope of the actions on the data side. Two options - "Whole" and "Sound objects" - are available.
When the "Whole" setting is chosen, the program does not need to know or to do anything special.
For example, you can select the "Whole" option to control music.
By opposition, it is necessary to set the scope to specific sound objects when several instances of an event may occur simultaneously, such as the sound of a missile.
Otherwise, if the scope for the missile impact cue is set to "Whole" then all the missiles that are flying will strike when the action is triggered!
ADX for Unity does not support the creation of sound objects in a program.
A cue whose scope is set to sound objects will affect only the cues that are played with the same player handle.
Create a few player handles in the program and switch them based on the scope of the action function.
Effect of an action
Scope type
Whole
Scope type
Sound objects
Played with the same player Yes Yes
Played with different players Yes No