TilePlus Version 5
Unity3D Tilemap Extension
Loading...
Searching...
No Matches
TilePlus.TpTileZoneAction Class Reference

Assets of this type are added as refs to TilePlus tiles. More...

Inheritance diagram for TilePlus.TpTileZoneAction:
Collaboration diagram for TilePlus.TpTileZoneAction:

Public Member Functions

virtual bool Exec (TilePlusBase sourceInstance, Type? targetType, string tagString, ObjectPacket.EventsPropagationMode eventPropagationMode=ObjectPacket.EventsPropagationMode.None, string optionalString="", int optionalInt=0, bool optionalBool=false, object? optionalObject=null)
 Messages other tiles. Fetches the Zone Bounds from a tile. Messages tiles which implement IZoneActionTarget, and have an explicit implementation of an ObjectPacket message target. Note the different way that the 'zone' is used. For TpZoneSlideShow the zone is used to demark which tiles will be messaged. For others, such as TpZoneAnimator or TpAnimZoneLoader or TpAnimZoneSpawner, the zone is used to detect when a supplied grid coordinate is contained within the zone with the intent of some sort of state change.

Public Attributes

ScriptableObject? m_Subasset
 A subasset: optional.

Static Public Attributes

const string Command_ZoneAction = "ZONE_ACTION"
 Name used for info string in the ObjectPacket sent to targets.

Detailed Description

Assets of this type are added as refs to TilePlus tiles.

This base-class implementation uses the ObjectPacket message with the info string set to "ZONE_ACTION". This only matters if you use ObjectPacket for something else.

Note that the tile instance passed in is NOT saved. This is intentional to avoid memory leaks and other issues.

You don’t want to maintain state of any kind in an ZoneAction asset’s code unless you use that Action in only ONE tile asset. Similarly to other assets, changing serialized values in these assets in Editor-Play mode can cause all sorts of issues.

Member Function Documentation

◆ Exec()

virtual bool TilePlus.TpTileZoneAction.Exec ( TilePlusBase sourceInstance,
Type? targetType,
string tagString,
ObjectPacket.EventsPropagationMode eventPropagationMode = ObjectPacket::EventsPropagationMode::None,
string optionalString = "",
int optionalInt = 0,
bool optionalBool = false,
object? optionalObject = null )
virtual

Messages other tiles. Fetches the Zone Bounds from a tile. Messages tiles which implement IZoneActionTarget, and have an explicit implementation of an ObjectPacket message target. Note the different way that the 'zone' is used. For TpZoneSlideShow the zone is used to demark which tiles will be messaged. For others, such as TpZoneAnimator or TpAnimZoneLoader or TpAnimZoneSpawner, the zone is used to detect when a supplied grid coordinate is contained within the zone with the intent of some sort of state change.

Parameters
sourceInstanceTilePlus tile that's calling this method
tagStringoptional tags for targets
targetTypeType of tile to target. If null, all types.
optionalStringOptional string value for packet
optionalIntOptional int value for packet
optionalBoolOptional bool value for packet.
eventPropagationModehow receipients of the messages sent by this should or should not propagate the event.
optionalObjectoptional object value for packet.

This version messages tiles with an ObjectPacket message target, and targets MUST implement the IZoneActionReceiver interface. That allows individual tile instances to opt out of being sent messages.

Reimplemented in TilePlus.TpZoneActionRadio.

Member Data Documentation

◆ Command_ZoneAction

const string TilePlus.TpTileZoneAction.Command_ZoneAction = "ZONE_ACTION"
static

Name used for info string in the ObjectPacket sent to targets.

◆ m_Subasset

ScriptableObject? TilePlus.TpTileZoneAction.m_Subasset

A subasset: optional.

if it exists, the object field in the SelectionInspector will have an additonal button to open this.


The documentation for this class was generated from the following file:
  • /Users/jms/Documents/Tpt_55/TPT55/Assets/Plugins/TilePlus/Runtime/AssetScripts/Actions/TpTileZoneAction.cs