TilePlus Version 5
Unity3D Tilemap Extension
Loading...
Searching...
No Matches
TilePlus.ITilePlus Interface Reference

All tiles that want to use the special features of TilePlus Toolkit like the Tile+Brush and Tile+Painter need to implement this interface. NOTE: ensure that the methods and properties that are in the UNITY_EDITOR section below are placed in similarly-demarked regions in your code. Also be sure to provide backing fields for properties (if appropriate) to ensure serialization. More...

Inheritance diagram for TilePlus.ITilePlus:

Public Member Functions

void CleanUp ()
 Implement to perform cleanup. RequiresCleanup
void ResetState (TileResetOperation op)
 Reset the state of the tile.
void ActivateAnimation (bool turnOn, int startingFrame=0, bool ignoreRewindingState=false)
 Turn animation on/off for tiles which support it.
void PauseAnimation (bool pause)
 Pause a running animation.
void LoopEndedCallback ()
 Animated tiles must implement this: callback at end of animation sequence.
bool ExecEventAction (UnityEngine.Object? obj)
 Exec the event action, if any.

Public Attributes

int count
 Property to get an array of individually-trimmed tags.

Properties

byte?[] TileGuidBytes [get, set]
 The GUID for the tile as bytes. An implementation of 'set' should be write-once.
Guid TileGuid [get]
 Get the Tile GUID as a GUID struct by converting TileGuidBytes.
string TileGuidString [get]
 string representation of GUID
TilePlusBase ThisTileInstance [get]
 Get the tile's instance thru this interface.
int Id [get]
 Id of tile. Nominally GetInstanceId. Default returns 0.
string Tag [get, set]
 Return a Tag for classes which implement a tag.
int string[] tags TrimmedTags [get]
Scene ParentScene [get]
 Return the scene that the Tile is in. Only works on a placed tile; on a non-cloned tile it should return default Note: check the return value for Scene.IsValid.
SpriteClearMode TileSpriteClear [get, set]
 Get the the tile sprite clear mode.
ColliderMode TileColliderMode [get, set]
 Get the tile collider mode.
Vector3Int TileGridPosition [get]
 This is the tile grid position as set from the Tile's StartUp method. This does not need a serialized backing field as it's refreshed during edit time and is refreshed at application start when StartUp is called.
Vector3Int LastTileGridPosition [get]
 Get the last tile grid position. Nonserialized if use backing field.
Tilemap? LastParentTilemap [get]
 Get the last parent Tilemap. Nonserialized backing field.
bool TileGridPosHasChanged [get]
 Has the tile position changed since the last StartUp?
Vector3 TileWorldPosition [get]
 Handy property to get the world position from the TileGridPosition property. returns Vector3.negativeInfinity for error SO CHECK FOR THAT! note: returns cell center as world position.
Tilemap? ParentTilemap [get]
 This is the Parent Tilemap as set from the Tile's StartUp method. This does not need a serialized backing field as it's refreshed during edit time and is refreshed at application start when StartUp is called.
bool ParentTilemapHasChanged [get]
 This flag is true if the parent tilemap for a tile has changed. The backing field should NOT be serialized.
bool IsAsset [get]
 Is this an asset? Read-only.
bool RequiresCleanup [get]
 If a particular tile requires special cleanup prior to deletion, EXPLICITLY implement this method and return TRUE. TpZoneAnimator
string TileStateString [get]
 String version of TileState.
bool AnimationIsPaused [get]
 Property to determine if animation is PAUSED.
bool AnimationIsRunning [get]
 Property to determine if Tile animation is ACTIVE and not paused: IE actual animation is running.
bool TileAnimationActive [get]
 Property to determine if animation is running in the tile. Note: running=true and paused=true is fine.
bool IsClone [get]
 return a variable that denotes whether this Tile is a clone.
bool IsLocked [get]
 return a variable that denotes whether this Tile is Locked.
bool IsComputeOnly [get]
 Indicate that this tile is 'compute only'.
GameObject? InstantiatedGameObject [get]
 Get the GameObject of the tile. Convenience, saves casting in editors.
int ParentTilemapInstanceId [get]
 The instance ID of the parent tilemap.
bool IsOneShotWaitingToRewind [get]
 Is the animation waiting to rewind?
bool AnimationSupported [get]
 This tile supports animation if true.
OversizeSpriteMode OversizeSpriteMode [get]
 This is used by the PositionDb to calculate the actual size of a sprite when determining if a position is occupied.
Vector2 SpriteSize [get]
 What is the size of the sprite? Override when implementing OversizeSpriteMode.
TpTileEventActionEventAction [get]
 A TpTileEventAction.
object? EventActionObject [get, set]
 If a tile is using TpEvents to pass events to a EventAction and said tile wants to include an arbitrary data object, make it available through this property. It will be passed to the event action in the 'obj' input parameter. TpUiButtonEventAction.Exec
TpTileZoneActionZoneAction [get]
 A TpTileZoneAction.
BoundsInt ZoneBoundsInt [get, set]
 For use with Zone Actions. Optional: implement in classes with zones.
Bounds ZoneBounds [get]
 A bounds based on the ZoneBoundsInt For use with Zone Actions. Optional: implement in classes with zones.

Detailed Description

All tiles that want to use the special features of TilePlus Toolkit like the Tile+Brush and Tile+Painter need to implement this interface. NOTE: ensure that the methods and properties that are in the UNITY_EDITOR section below are placed in similarly-demarked regions in your code. Also be sure to provide backing fields for properties (if appropriate) to ensure serialization.

Inherit from TilePlusBase if at all possible! Using this interface alone will probably not be enough. Also note the use of default interface properties. –User code should not write to this property – for some properties: this means that the implementation does not (or should not) allow writes to the backing field when the Editor is in Play mode.

Member Function Documentation

◆ ActivateAnimation()

void TilePlus.ITilePlus.ActivateAnimation ( bool turnOn,
int startingFrame = 0,
bool ignoreRewindingState = false )

Turn animation on/off for tiles which support it.

Parameters
turnOntrue/false = on/off
startingFramesets the current frame to 0 (for either operation). Use -1 to inhibit.
ignoreRewindingStateif false(default) then this method does not execute when waiting for a rewind - only when one-shot is used w/rewindAfterOneShot set true

Also see AnimationSupported property. Also, when turnOn==true, the startingFrame is set prior to starting animation. When false, the startingFrame is set after stopping the animation

Implemented in TilePlus.TilePlusBase, TilePlus.TpAnimatedTile, and TilePlus.TpFlexAnimatedTile.

◆ CleanUp()

void TilePlus.ITilePlus.CleanUp ( )

Implement to perform cleanup. RequiresCleanup

Implemented in TilePlus.TilePlusBase, and TilePlus.TpZoneAnimator.

◆ ExecEventAction()

bool TilePlus.ITilePlus.ExecEventAction ( UnityEngine.Object? obj)

Exec the event action, if any.

Parameters
objOptional param passed to the Zone Action.
Returns
false for error

If obj is null then the EventActionObject is used. See TilePlusBase.EventActionObject

◆ LoopEndedCallback()

void TilePlus.ITilePlus.LoopEndedCallback ( )

Animated tiles must implement this: callback at end of animation sequence.

Implemented in TilePlus.TilePlusBase, TilePlus.TpAnimatedTile, and TilePlus.TpFlexAnimatedTile.

◆ PauseAnimation()

void TilePlus.ITilePlus.PauseAnimation ( bool pause)

Pause a running animation.

Parameters
pause

Implemented in TilePlus.TilePlusBase, TilePlus.TpAnimatedTile, and TilePlus.TpFlexAnimatedTile.

◆ ResetState()

Member Data Documentation

◆ count

int TilePlus.ITilePlus.count

Property to get an array of individually-trimmed tags.

returns null if there are no tags, or an empty list if all trimmed tags eval to empty>

Property Documentation

◆ AnimationIsPaused

bool TilePlus.ITilePlus.AnimationIsPaused
get

Property to determine if animation is PAUSED.

true if animation is paused

Implemented in TilePlus.TilePlusBase.

◆ AnimationIsRunning

bool TilePlus.ITilePlus.AnimationIsRunning
get

Property to determine if Tile animation is ACTIVE and not paused: IE actual animation is running.

Implemented in TilePlus.TilePlusBase.

◆ AnimationSupported

bool TilePlus.ITilePlus.AnimationSupported
get

This tile supports animation if true.

Implemented in TilePlus.TpAnimatedTile, and TilePlus.TpFlexAnimatedTile.

◆ EventAction

TpTileEventAction? TilePlus.ITilePlus.EventAction
get

◆ EventActionObject

object? TilePlus.ITilePlus.EventActionObject
getset

If a tile is using TpEvents to pass events to a EventAction and said tile wants to include an arbitrary data object, make it available through this property. It will be passed to the event action in the 'obj' input parameter. TpUiButtonEventAction.Exec

Implemented in TilePlus.TilePlusBase, TilePlus.UiAnimButtonTile, and TilePlus.UiButtonTile.

◆ Id

int TilePlus.ITilePlus.Id
get

Id of tile. Nominally GetInstanceId. Default returns 0.

Implemented in TilePlus.TilePlusBase.

◆ InstantiatedGameObject

GameObject? TilePlus.ITilePlus.InstantiatedGameObject
get

Get the GameObject of the tile. Convenience, saves casting in editors.

◆ IsAsset

bool TilePlus.ITilePlus.IsAsset
get

Is this an asset? Read-only.

true if this instance is an asset; otherwise, false.

Implemented in TilePlus.TilePlusBase.

◆ IsClone

bool TilePlus.ITilePlus.IsClone
get

return a variable that denotes whether this Tile is a clone.

true if this instance is a clone; otherwise, false.

Implemented in TilePlus.TilePlusBase.

◆ IsComputeOnly

bool TilePlus.ITilePlus.IsComputeOnly
get

Indicate that this tile is 'compute only'.

◆ IsLocked

bool TilePlus.ITilePlus.IsLocked
get

return a variable that denotes whether this Tile is Locked.

true if this instance is locked; otherwise, false.

Locked means that the tile is no longer a scene object, it's from an asset file.

Implemented in TilePlus.TilePlusBase.

◆ IsOneShotWaitingToRewind

bool TilePlus.ITilePlus.IsOneShotWaitingToRewind
get

Is the animation waiting to rewind?

Implemented in TilePlus.TilePlusBase, TilePlus.TpAnimatedTile, and TilePlus.TpFlexAnimatedTile.

◆ LastParentTilemap

Tilemap? TilePlus.ITilePlus.LastParentTilemap
get

Get the last parent Tilemap. Nonserialized backing field.

Implemented in TilePlus.TilePlusBase.

◆ LastTileGridPosition

Vector3Int TilePlus.ITilePlus.LastTileGridPosition
get

Get the last tile grid position. Nonserialized if use backing field.

The last tile grid position.

Implemented in TilePlus.TilePlusBase.

◆ OversizeSpriteMode

OversizeSpriteMode TilePlus.ITilePlus.OversizeSpriteMode
get

This is used by the PositionDb to calculate the actual size of a sprite when determining if a position is occupied.

Implemented in TilePlus.TilePlusBase.

◆ ParentScene

Scene TilePlus.ITilePlus.ParentScene
get

Return the scene that the Tile is in. Only works on a placed tile; on a non-cloned tile it should return default Note: check the return value for Scene.IsValid.

The parent scene.

Intentionally non-virtual

◆ ParentTilemap

Tilemap? TilePlus.ITilePlus.ParentTilemap
get

This is the Parent Tilemap as set from the Tile's StartUp method. This does not need a serialized backing field as it's refreshed during edit time and is refreshed at application start when StartUp is called.

The parent tilemap.

Implemented in TilePlus.TilePlusBase.

◆ ParentTilemapHasChanged

bool TilePlus.ITilePlus.ParentTilemapHasChanged
get

This flag is true if the parent tilemap for a tile has changed. The backing field should NOT be serialized.

Implemented in TilePlus.TilePlusBase.

◆ ParentTilemapInstanceId

int TilePlus.ITilePlus.ParentTilemapInstanceId
get

The instance ID of the parent tilemap.

Implemented in TilePlus.TilePlusBase.

◆ RequiresCleanup

bool TilePlus.ITilePlus.RequiresCleanup
get

If a particular tile requires special cleanup prior to deletion, EXPLICITLY implement this method and return TRUE. TpZoneAnimator

Implemented in TilePlus.TilePlusBase, and TilePlus.TpZoneAnimator.

◆ SpriteSize

Vector2 TilePlus.ITilePlus.SpriteSize
get

What is the size of the sprite? Override when implementing OversizeSpriteMode.

Implemented in TilePlus.TilePlusBase.

◆ Tag

string TilePlus.ITilePlus.Tag
getset

Return a Tag for classes which implement a tag.

The tag.

User code should not write to this property

Implemented in TilePlus.TilePlusBase.

◆ ThisTileInstance

TilePlusBase TilePlus.ITilePlus.ThisTileInstance
get

Get the tile's instance thru this interface.

Implemented in TilePlus.TilePlusBase.

◆ TileAnimationActive

bool TilePlus.ITilePlus.TileAnimationActive
get

Property to determine if animation is running in the tile. Note: running=true and paused=true is fine.

Implemented in TilePlus.TilePlusBase.

◆ TileColliderMode

ColliderMode TilePlus.ITilePlus.TileColliderMode
getset

Get the tile collider mode.

The tile collider mode.

User code should not write to this property

Implemented in TilePlus.TilePlusBase.

◆ TileGridPosHasChanged

bool TilePlus.ITilePlus.TileGridPosHasChanged
get

Has the tile position changed since the last StartUp?

true if the tile grid position has changed; otherwise, false.

Implemented in TilePlus.TilePlusBase.

◆ TileGridPosition

Vector3Int TilePlus.ITilePlus.TileGridPosition
get

This is the tile grid position as set from the Tile's StartUp method. This does not need a serialized backing field as it's refreshed during edit time and is refreshed at application start when StartUp is called.

The tile grid position.

Implemented in TilePlus.TilePlusBase.

◆ TileGuid

Guid TilePlus.ITilePlus.TileGuid
get

Get the Tile GUID as a GUID struct by converting TileGuidBytes.

The tile's GUID.

Implemented in TilePlus.TilePlusBase.

◆ TileGuidBytes

byte? [] TilePlus.ITilePlus.TileGuidBytes
getset

The GUID for the tile as bytes. An implementation of 'set' should be write-once.

The tile unique identifier bytes.

Guid isn't serializable but byte[] is.

Implemented in TilePlus.TilePlusBase.

◆ TileGuidString

string TilePlus.ITilePlus.TileGuidString
get

string representation of GUID

The tile unique identifier string.

Implemented in TilePlus.TilePlusBase.

◆ TileSpriteClear

SpriteClearMode TilePlus.ITilePlus.TileSpriteClear
getset

Get the the tile sprite clear mode.

The SpriteClearMode value.

User code should not write to this property

Implemented in TilePlus.TilePlusBase.

◆ TileStateString

string TilePlus.ITilePlus.TileStateString
get

String version of TileState.

The tile state string.

Implemented in TilePlus.TilePlusBase.

◆ TileWorldPosition

Vector3 TilePlus.ITilePlus.TileWorldPosition
get

Handy property to get the world position from the TileGridPosition property. returns Vector3.negativeInfinity for error SO CHECK FOR THAT! note: returns cell center as world position.

The tile world position.

Implemented in TilePlus.TilePlusBase.

◆ TrimmedTags

int string [] tags TilePlus.ITilePlus.TrimmedTags
get

Implemented in TilePlus.TilePlusBase.

◆ ZoneAction

TpTileZoneAction? TilePlus.ITilePlus.ZoneAction
get

◆ ZoneBounds

Bounds TilePlus.ITilePlus.ZoneBounds
get

A bounds based on the ZoneBoundsInt For use with Zone Actions. Optional: implement in classes with zones.

Implemented in TilePlus.TilePlusBase.

◆ ZoneBoundsInt

BoundsInt TilePlus.ITilePlus.ZoneBoundsInt
getset

For use with Zone Actions. Optional: implement in classes with zones.

Implemented in TilePlus.TilePlusBase.


The documentation for this interface was generated from the following file:
  • /Users/jms/Documents/Tpt_55/TPT55/Assets/Plugins/TilePlus/Runtime/Interface/ITilePlus.cs