Class RuleOverrideTile
Rule Override Tiles are Tiles which can override a subset of Rules for a given Rule Tile to provide specialised behaviour while keeping most of the Rules originally set in the Rule Tile.
Inherited Members
Namespace: UnityEngine.Tilemaps
Syntax
[MovedFrom(true, "UnityEngine", null, null)]
[Serializable]
[CreateAssetMenu(fileName = "New Rule Override Tile", menuName = "Tiles/Rule Override Tile")]
public class RuleOverrideTile : TileBase
Fields
m_GameObjects
A list of GameObject Overrides
Declaration
public List<RuleOverrideTile.TileGameObjectPair> m_GameObjects
Field Value
Type | Description |
---|---|
List<RuleOverrideTile.TileGameObjectPair> |
m_InstanceTile
Returns the Rule Tile for retrieving TileData
Declaration
[HideInInspector]
public RuleTile m_InstanceTile
Field Value
Type | Description |
---|---|
RuleTile |
m_Sprites
A list of Sprite Overrides
Declaration
public List<RuleOverrideTile.TileSpritePair> m_Sprites
Field Value
Type | Description |
---|---|
List<RuleOverrideTile.TileSpritePair> |
m_Tile
The RuleTile to override
Declaration
public RuleTile m_Tile
Field Value
Type | Description |
---|---|
RuleTile |
Properties
Item[GameObject]
Gets the overriding GameObject of a given GameObject.
Declaration
public GameObject this[GameObject originalGameObject] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
GameObject | originalGameObject |
Property Value
Type | Description |
---|---|
GameObject |
Item[Sprite]
Gets the overriding Sprite of a given Sprite.
Declaration
public Sprite this[Sprite originalSprite] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Sprite | originalSprite |
Property Value
Type | Description |
---|---|
Sprite |
Methods
ApplyOverrides(IList<KeyValuePair<GameObject, GameObject>>)
Applies overrides to this
Declaration
public void ApplyOverrides(IList<KeyValuePair<GameObject, GameObject>> overrides)
Parameters
Type | Name | Description |
---|---|---|
IList<KeyValuePair<GameObject, GameObject>> | overrides | A list of overrides to apply |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The input overrides list is not valid |
ApplyOverrides(IList<KeyValuePair<Sprite, Sprite>>)
Applies overrides to this
Declaration
public void ApplyOverrides(IList<KeyValuePair<Sprite, Sprite>> overrides)
Parameters
Type | Name | Description |
---|---|---|
IList<KeyValuePair<Sprite, Sprite>> | overrides | A list of overrides to apply |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The input overrides list is not valid |
GetOverrides(List<KeyValuePair<GameObject, GameObject>>, ref Int32)
Gets overrides for this
Declaration
public void GetOverrides(List<KeyValuePair<GameObject, GameObject>> overrides, ref int validCount)
Parameters
Type | Name | Description |
---|---|---|
List<KeyValuePair<GameObject, GameObject>> | overrides | A list of overrides to fill |
Int32 | validCount |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The input overrides list is not valid |
GetOverrides(List<KeyValuePair<Sprite, Sprite>>, ref Int32)
Gets overrides for this
Declaration
public void GetOverrides(List<KeyValuePair<Sprite, Sprite>> overrides, ref int validCount)
Parameters
Type | Name | Description |
---|---|---|
List<KeyValuePair<Sprite, Sprite>> | overrides | A list of overrides to fill |
Int32 | validCount |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The input overrides list is not valid |
GetTileAnimationData(Vector3Int, ITilemap, ref TileAnimationData)
Retrieves any tile animation data from the scripted tile.
Declaration
public override bool GetTileAnimationData(Vector3Int position, ITilemap tilemap, ref TileAnimationData tileAnimationData)
Parameters
Type | Name | Description |
---|---|---|
Vector3Int | position | Position of the Tile on the Tilemap. |
ITilemap | tilemap | The Tilemap the tile is present on. |
TileAnimationData | tileAnimationData | Data to run an animation on the tile. |
Returns
Type | Description |
---|---|
Boolean | Whether the call was successful. |
Overrides
GetTileData(Vector3Int, ITilemap, ref TileData)
Retrieves any tile rendering data from the scripted tile.
Declaration
public override void GetTileData(Vector3Int position, ITilemap tilemap, ref TileData tileData)
Parameters
Type | Name | Description |
---|---|---|
Vector3Int | position | Position of the Tile on the Tilemap. |
ITilemap | tilemap | The Tilemap the tile is present on. |
TileData | tileData | Data to render the tile. |
Overrides
Override()
Declaration
public virtual void Override()
PrepareOverride()
Declaration
public void PrepareOverride()
RefreshTile(Vector3Int, ITilemap)
This method is called when the tile is refreshed.
Declaration
public override void RefreshTile(Vector3Int position, ITilemap tilemap)
Parameters
Type | Name | Description |
---|---|---|
Vector3Int | position | |
ITilemap | tilemap |
Overrides
StartUp(Vector3Int, ITilemap, GameObject)
StartUp is called on the first frame of the running Scene.
Declaration
public override bool StartUp(Vector3Int position, ITilemap tilemap, GameObject go)
Parameters
Type | Name | Description |
---|---|---|
Vector3Int | position | |
ITilemap | tilemap | The Tilemap the tile is present on. |
GameObject | go |
Returns
Type | Description |
---|---|
Boolean | Whether StartUp was successful |