Struct TilePosition
Helper class to convert map and tile positions.
Namespace: TycoonTerrain.Core
Assembly: TycoonTerrainAssembly.dll
Syntax
public struct TilePosition
Properties
Invalid
Gets an invalid tile position.
Declaration
public static int2 Invalid { get; }
Property Value
Type | Description |
---|---|
Unity.Mathematics.int2 | An invalid tile position. |
Methods
MapToLocalPosition(float3)
Converts the map position to the local position within a tile.
Declaration
public static float2 MapToLocalPosition(float3 mapPosition)
Parameters
Type | Name | Description |
---|---|---|
Unity.Mathematics.float3 | mapPosition | The position on the TycoonTile map. |
Returns
Type | Description |
---|---|
Unity.Mathematics.float2 | The local tile position that corresponds to |
MapToTilePosition(float3)
Converts the map position to the tile position.
Declaration
public static int2 MapToTilePosition(float3 mapPosition)
Parameters
Type | Name | Description |
---|---|---|
Unity.Mathematics.float3 | mapPosition | The position on the TycoonTile map. |
Returns
Type | Description |
---|---|
Unity.Mathematics.int2 | The tile position that corresponds to |