Skip to main content

Event and Zone Actions and SubObjects

AnimatorAction

Animator Actions are project-level scriptable object plugins. They're only used with TpZoneAnimator tiles.

If you specify an action for one of the three sets of Actions (in the tile) it will ALWAYS be used instead of one of the specified 'StateName' fields.

The plugin get passed the tile instance. Inherit from the TpAnimatorAction class (see the example in the Layout demo).

The base class doesn't do anything and there's no asset create menu item for it.

If you specify an action for one of the three sets of Actions (in the tile) it will ALWAYS be used instead of one of the specified 'StateName' fields.

You can do whatever you want within the Action and the tile instance gives access to all the fields/properties like Target (the prefab) and PrefabAnimator.

Note that these values may be null depending on when an Action is invoked, e.g., when an ActionAtStart is used the animator may be null.

For example, if you want to use 'setfloat', 'setbool' etc: use an Action. This tile only uses the Animator.Play methods (though you can hack this code in a derived class).

If an Action spawns any prefabs and you want such prefabs to be auto-deleted when the Player moves out of the zone (ie when you use messaging to send the position to the tile and the position is outside of the zone) then add refs to these prefabs via AddSpawnedGameObject.

An Action can use its parent ZoneAnimator tile's CleanupPrefabs() to delete the prefabs; normally this is done automatically when the zone is exited OR if an AnimatorControlPacket causes a despawn (see below).

TileEventAction

These are project-level scriptable object plugins added as references to TPT tiles.

Takes an action when a TileEvent is evaluated by a controlling program. If the program uses TpEvents.ProcessEvents the Exec method in these plugins can be optionally invoked automatically. See Events.

TileZoneAction

These are similar to EventActions, but aren't automatically invoked in TilePlus. Generally the Exec method of these plugins is invoked by a TPT tile while acting on a message. See ZoneActions.

TweenerSubObject

This is a scriptable object plugins added to Event or Zone actions for adding tween capability to those plugins. See this.

UiButtonEventAction

An example Event Action for the UiButton tile that changes values on specified tiles using the UiControl interface.

ZoneActionRadio

An example Zone Acton for the UiToggleButton tile. This implements a radio-button set of toggle buttons using a Zone or a tag.