Class HexagonalRuleEntityIdTile
Generic visual tile for creating different tilesets like terrain, pipeline, random or animated tiles. Use this for Hexagonal Grids.
Inheritance
Inherited Members
Namespace: Unity.Tilemaps.Experimental
Assembly: Unity.2D.Tilemap.Experimental.dll
Syntax
[Serializable]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.2d.tilemap.extras@latest/index.html?subfolder=/manual/RuleTile.html")]
public class HexagonalRuleEntityIdTile : RuleEntityIdTile
Fields
m_FlatTop
Whether this is a flat top Hexagonal Tile
Declaration
public bool m_FlatTop
Field Value
| Type | Description |
|---|---|
| bool |
Properties
getTileAnimationDataJobDelegate
Returns the delegate function called by Tilemap using Unity Jobs to get Tile Animation Data from HexagonalRuleEntityIdTiles
Declaration
protected override EntityIdTileBase.GetTileAnimationDataJobDelegate getTileAnimationDataJobDelegate { get; }
Property Value
| Type | Description |
|---|---|
| EntityIdTileBase.GetTileAnimationDataJobDelegate |
Overrides
getTileDataJobDelegate
Returns the delegate function called by Tilemap using Unity Jobs to get Tile Data from HexagonalRuleEntityIdTiles
Declaration
protected override EntityIdTileBase.GetTileDataJobDelegate getTileDataJobDelegate { get; }
Property Value
| Type | Description |
|---|---|
| EntityIdTileBase.GetTileDataJobDelegate |
Overrides
m_RotationAngle
Angle in which the HexagonalRuleTile is rotated by for matching in Degrees.
Declaration
public override int m_RotationAngle { get; }
Property Value
| Type | Description |
|---|---|
| int |
Overrides
refreshTileJobDelegate
Returns the delegate function called by Tilemap using Unity Jobs to refresh HexagonalRuleEntityIdTiles
Declaration
protected override EntityIdTileBase.RefreshTileJobDelegate refreshTileJobDelegate { get; }
Property Value
| Type | Description |
|---|---|
| EntityIdTileBase.RefreshTileJobDelegate |
Overrides
structType
Returns the type of data struct used for the HexagonalRuleEntityIdTile, which is the type of HexagonalRuleEntityIdTileDataStruct.
Declaration
public override Type structType { get; }
Property Value
| Type | Description |
|---|---|
| Type |
Overrides
Methods
CopyDataStruct(void*)
Copies the Data struct used for this HexagonalRuleEntityIdTile to the outPtr buffer for use in Unity Jobs.
Declaration
public override void CopyDataStruct(void* outPtr)
Parameters
| Type | Name | Description |
|---|---|---|
| void* | outPtr | Data buffer to copy data struct from HexagonalRuleEntityIdTile to. |
Overrides
GetMirroredPosition(int3, bool, bool)
Gets a mirrored position given its original position and the mirroring axii.
Declaration
public override int3 GetMirroredPosition(int3 position, bool mirrorX, bool mirrorY)
Parameters
| Type | Name | Description |
|---|---|---|
| int3 | position | Original position of Tile. |
| bool | mirrorX | Mirror in the X Axis. |
| bool | mirrorY | Mirror in the Y Axis. |
Returns
| Type | Description |
|---|---|
| int3 | Mirrored position of Tile. |
Overrides
GetOffsetPosition(int3, int3)
Get the offset for the given position with the given offset.
Declaration
public override int3 GetOffsetPosition(int3 position, int3 offset)
Parameters
| Type | Name | Description |
|---|---|---|
| int3 | position | Position to offset. |
| int3 | offset | Offset for the position. |
Returns
| Type | Description |
|---|---|
| int3 | The offset position. |
Overrides
GetOffsetPositionReverse(int3, int3)
Get the reversed offset for the given position with the given offset.
Declaration
public override int3 GetOffsetPositionReverse(int3 position, int3 offset)
Parameters
| Type | Name | Description |
|---|---|---|
| int3 | position | Position to offset. |
| int3 | offset | Offset for the position. |
Returns
| Type | Description |
|---|---|
| int3 | The reversed offset position. |
Overrides
GetRotatedPosition(int3, int)
Gets a rotated position given its original position and the rotation in degrees.
Declaration
[BurstCompile]
public override int3 GetRotatedPosition(int3 position, int rotation)
Parameters
| Type | Name | Description |
|---|---|---|
| int3 | position | Original position of Tile. |
| int | rotation | Rotation in degrees. |
Returns
| Type | Description |
|---|---|
| int3 | Rotated position of Tile. |
Overrides
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 |
|---|---|
| bool | 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
OnDisable()
Cleans up the HexagonalRuleEntityIdTile.
Declaration
public override void OnDisable()
Overrides
OnEnable()
Initializes the HexagonalRuleEntityIdTile.
Declaration
public override void OnEnable()
Overrides
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 | Position of the Tile on the Tilemap. |
| ITilemap | tilemap | The Tilemap the tile is present on. |
Overrides
RuleMatches(ref RuleMatchInput, ref TilemapDataStruct, ref HexagonalRuleEntityIdTileDataStruct, ref int3, bool, bool)
Checks if there is a match given the neighbor matching rule and a Tile with mirrored axii.
Declaration
[BurstCompile]
public static bool RuleMatches(ref RuleMatchInput ruleMatch, ref TilemapDataStruct tilemapData, ref HexagonalRuleEntityIdTile.HexagonalRuleEntityIdTileDataStruct tileData, ref int3 position, bool mirrorX, bool mirrorY)
Parameters
| Type | Name | Description |
|---|---|---|
| RuleMatchInput | ruleMatch | Neighbor matching rule. |
| TilemapDataStruct | tilemapData | Tilemap to match. |
| HexagonalRuleEntityIdTile.HexagonalRuleEntityIdTileDataStruct | tileData | Tile to match. |
| int3 | position | Position of the Tile on the Tilemap. |
| bool | mirrorX | Mirror X Axis for matching. |
| bool | mirrorY | Mirror Y Axis for matching. |
Returns
| Type | Description |
|---|---|
| bool | True if there is a match, False if not. |
RuleMatches(ref RuleMatchInput, ref TilemapDataStruct, ref HexagonalRuleEntityIdTileDataStruct, ref int3, int, bool)
Checks if there is a match given the neighbor matching rule and a Tile with a rotation angle.
Declaration
[BurstCompile]
public static bool RuleMatches(ref RuleMatchInput ruleMatch, ref TilemapDataStruct tilemapData, ref HexagonalRuleEntityIdTile.HexagonalRuleEntityIdTileDataStruct tileData, ref int3 position, int angle, bool mirrorX = false)
Parameters
| Type | Name | Description |
|---|---|---|
| RuleMatchInput | ruleMatch | Neighbor matching rule. |
| TilemapDataStruct | tilemapData | Tilemap to match. |
| HexagonalRuleEntityIdTile.HexagonalRuleEntityIdTileDataStruct | tileData | Tile to match. |
| int3 | position | Position of the Tile on the Tilemap. |
| int | angle | Rotation angle for matching. |
| bool | mirrorX | Mirror X Axis for matching. |
Returns
| Type | Description |
|---|---|
| bool | True if there is a match, False if not. |
RuleMatches(ref RuleMatchInput, ref TilemapDataStruct, ref HexagonalRuleEntityIdTileDataStruct, ref int3, ref AffineTransform)
Does a Rule Match given a Tiling Rule and neighboring Tiles.
Declaration
[BurstCompile]
public static bool RuleMatches(ref RuleMatchInput ruleMatch, ref TilemapDataStruct tilemapData, ref HexagonalRuleEntityIdTile.HexagonalRuleEntityIdTileDataStruct tileData, ref int3 position, ref AffineTransform transform)
Parameters
| Type | Name | Description |
|---|---|---|
| RuleMatchInput | ruleMatch | The Tiling Rule to match with. |
| TilemapDataStruct | tilemapData | The tilemap to match with. |
| HexagonalRuleEntityIdTile.HexagonalRuleEntityIdTileDataStruct | tileData | The Tile's data as a struct. |
| int3 | position | Position of the Tile on the Tilemap. |
| AffineTransform | transform | A transform matrix which will match the Rule. |
Returns
| Type | Description |
|---|---|
| bool | True if there is a match, False if not. |
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 instantiatedGameObject)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3Int | position | Position of the Tile on the Tilemap. |
| ITilemap | tilemap | The Tilemap the tile is present on. |
| GameObject | instantiatedGameObject | The GameObject instantiated for the Tile. |
Returns
| Type | Description |
|---|---|
| bool | Whether StartUp was successful |