![]() |
TilePlus Version 5
Unity3D Tilemap Extension
|
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...

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. | |
| TpTileEventAction? | EventAction [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 | |
| TpTileZoneAction? | ZoneAction [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. | |
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.
| void TilePlus.ITilePlus.ActivateAnimation | ( | bool | turnOn, |
| int | startingFrame = 0, | ||
| bool | ignoreRewindingState = false ) |
Turn animation on/off for tiles which support it.
| turnOn | true/false = on/off |
| startingFrame | sets the current frame to 0 (for either operation). Use -1 to inhibit. |
| ignoreRewindingState | if 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.
| void TilePlus.ITilePlus.CleanUp | ( | ) |
Implement to perform cleanup. RequiresCleanup
Implemented in TilePlus.TilePlusBase, and TilePlus.TpZoneAnimator.
| bool TilePlus.ITilePlus.ExecEventAction | ( | UnityEngine.Object? | obj | ) |
Exec the event action, if any.
| obj | Optional param passed to the Zone Action. |
If obj is null then the EventActionObject is used. See TilePlusBase.EventActionObject
| void TilePlus.ITilePlus.LoopEndedCallback | ( | ) |
Animated tiles must implement this: callback at end of animation sequence.
Implemented in TilePlus.TilePlusBase, TilePlus.TpAnimatedTile, and TilePlus.TpFlexAnimatedTile.
| void TilePlus.ITilePlus.PauseAnimation | ( | bool | pause | ) |
Pause a running animation.
| pause |
Implemented in TilePlus.TilePlusBase, TilePlus.TpAnimatedTile, and TilePlus.TpFlexAnimatedTile.
| void TilePlus.ITilePlus.ResetState | ( | TileResetOperation | op | ) |
Reset the state of the tile.
| op | The type of reset operation |
Implemented in TilePlus.TilePlusBase, TilePlus.TpAnimatedSpawner, TilePlus.TpAnimZoneLoader, TilePlus.TpAnimZoneSpawner, TilePlus.TpFlexAnimatedTile, TilePlus.TpTweenerFlexTile, TilePlus.TpTweenSpecSequenceTile, and TilePlus.TpTweenSpecTile.
| 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>
|
get |
Property to determine if animation is PAUSED.
true if animation is paused
Implemented in TilePlus.TilePlusBase.
|
get |
Property to determine if Tile animation is ACTIVE and not paused: IE actual animation is running.
Implemented in TilePlus.TilePlusBase.
|
get |
This tile supports animation if true.
Implemented in TilePlus.TpAnimatedTile, and TilePlus.TpFlexAnimatedTile.
|
get |
Implemented in TilePlus.TilePlusBase.
|
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.
|
get |
Id of tile. Nominally GetInstanceId. Default returns 0.
Implemented in TilePlus.TilePlusBase.
|
get |
Get the GameObject of the tile. Convenience, saves casting in editors.
|
get |
Is this an asset? Read-only.
true if this instance is an asset; otherwise, false.
Implemented in TilePlus.TilePlusBase.
|
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.
|
get |
Indicate that this tile is 'compute only'.
|
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.
|
get |
Is the animation waiting to rewind?
Implemented in TilePlus.TilePlusBase, TilePlus.TpAnimatedTile, and TilePlus.TpFlexAnimatedTile.
|
get |
Get the last parent Tilemap. Nonserialized backing field.
Implemented in TilePlus.TilePlusBase.
|
get |
Get the last tile grid position. Nonserialized if use backing field.
The last tile grid position.
Implemented in TilePlus.TilePlusBase.
|
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.
|
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
|
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.
|
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.
|
get |
The instance ID of the parent tilemap.
Implemented in TilePlus.TilePlusBase.
|
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.
|
get |
What is the size of the sprite? Override when implementing OversizeSpriteMode.
Implemented in TilePlus.TilePlusBase.
|
getset |
Return a Tag for classes which implement a tag.
The tag.
User code should not write to this property
Implemented in TilePlus.TilePlusBase.
|
get |
Get the tile's instance thru this interface.
Implemented in TilePlus.TilePlusBase.
|
get |
Property to determine if animation is running in the tile. Note: running=true and paused=true is fine.
Implemented in TilePlus.TilePlusBase.
|
getset |
Get the tile collider mode.
The tile collider mode.
User code should not write to this property
Implemented in TilePlus.TilePlusBase.
|
get |
Has the tile position changed since the last StartUp?
true if the tile grid position has changed; otherwise, false.
Implemented in TilePlus.TilePlusBase.
|
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.
|
get |
Get the Tile GUID as a GUID struct by converting TileGuidBytes.
The tile's GUID.
Implemented in TilePlus.TilePlusBase.
|
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.
|
get |
string representation of GUID
The tile unique identifier string.
Implemented in TilePlus.TilePlusBase.
|
getset |
Get the the tile sprite clear mode.
The SpriteClearMode value.
User code should not write to this property
Implemented in TilePlus.TilePlusBase.
|
get |
|
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.
|
get |
Implemented in TilePlus.TilePlusBase.
|
get |
Implemented in TilePlus.TilePlusBase.
|
get |
A bounds based on the ZoneBoundsInt For use with Zone Actions. Optional: implement in classes with zones.
Implemented in TilePlus.TilePlusBase.
|
getset |
For use with Zone Actions. Optional: implement in classes with zones.
Implemented in TilePlus.TilePlusBase.