Class HexagonalRuleTile
Generic visual tile for creating different tilesets like terrain, pipeline, random or animated tiles. Use this for Hexagonal Grids.
Inherited Members
Namespace: UnityEngine
Assembly: Unity.2D.Tilemap.Extras.dll
Syntax
[Serializable]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.2d.tilemap.extras@latest/index.html?subfolder=/manual/RuleTile.html")]
public class HexagonalRuleTile : RuleTile
Fields
m_FlatTop
Whether this is a flat top Hexagonal Tile
Declaration
public bool m_FlatTop
Field Value
Type | Description |
---|---|
bool |
Properties
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
Methods
GetMirroredPosition(Vector3Int, bool, bool)
Gets a mirrored position given its original position and the mirroring axii.
Declaration
public override Vector3Int GetMirroredPosition(Vector3Int position, bool mirrorX, bool mirrorY)
Parameters
Type | Name | Description |
---|---|---|
Vector3Int | position | Original position of Tile. |
bool | mirrorX | Mirror in the X Axis. |
bool | mirrorY | Mirror in the Y Axis. |
Returns
Type | Description |
---|---|
Vector3Int | Mirrored position of Tile. |
Overrides
GetOffsetPosition(Vector3Int, Vector3Int)
Get the offset for the given position with the given offset.
Declaration
public override Vector3Int GetOffsetPosition(Vector3Int position, Vector3Int offset)
Parameters
Type | Name | Description |
---|---|---|
Vector3Int | position | Position to offset. |
Vector3Int | offset | Offset for the position. |
Returns
Type | Description |
---|---|
Vector3Int | The offset position. |
Overrides
GetOffsetPositionReverse(Vector3Int, Vector3Int)
Get the reversed offset for the given position with the given offset.
Declaration
public override Vector3Int GetOffsetPositionReverse(Vector3Int position, Vector3Int offset)
Parameters
Type | Name | Description |
---|---|---|
Vector3Int | position | Position to offset. |
Vector3Int | offset | Offset for the position. |
Returns
Type | Description |
---|---|
Vector3Int | The reversed offset position. |
Overrides
GetRotatedPosition(Vector3Int, int)
Gets a rotated position given its original position and the rotation in degrees.
Declaration
public override Vector3Int GetRotatedPosition(Vector3Int position, int rotation)
Parameters
Type | Name | Description |
---|---|---|
Vector3Int | position | Original position of Tile. |
int | rotation | Rotation in degrees. |
Returns
Type | Description |
---|---|
Vector3Int | Rotated position of Tile. |
Overrides
TilemapPositionToWorldPosition(Vector3Int)
Converts a Tilemap Position to World Position.
Declaration
public static Vector3 TilemapPositionToWorldPosition(Vector3Int tilemapPosition)
Parameters
Type | Name | Description |
---|---|---|
Vector3Int | tilemapPosition | Tilemap Position to convert. |
Returns
Type | Description |
---|---|
Vector3 | World Position. |
WorldPositionToTilemapPosition(Vector3)
Converts a World Position to Tilemap Position.
Declaration
public static Vector3Int WorldPositionToTilemapPosition(Vector3 worldPosition)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | worldPosition | World Position to convert. |
Returns
Type | Description |
---|---|
Vector3Int | Tilemap Position. |