tilemap based map implementation
whether map points are walkable or buildable depends on the tiles on a tilemap
the BuildingRequirement.GroundOptions have to be tile when used with this map
https://citybuilder.softleitner.com/manual
|
override bool | IsBuildable (Vector2Int point, int mask, object tag=null) |
| checks if a point is ok to build on or if the map somehow blocks building there
|
|
override bool | IsWalkable (Vector2Int point) |
| check if a point can be walked on and may be used in pathfinding
|
|
override bool | CheckGround (Vector2Int point, Object[] options) |
| checks the ground for certain features
for example in tilemap base maps this would be a tile
|
|
bool | IsInside (Vector2Int position) |
| checks if a point is inside the map size
|
|
bool | IsBuildable (Vector2Int position, int mask, object tag=null) |
| checks if a point is ok to build on or if the map somehow blocks building there
|
|
bool | IsWalkable (Vector2Int position) |
| check if a point can be walked on and may be used in pathfinding
|
|
bool | CheckGround (Vector2Int position, Object[] options) |
| checks the ground for certain features
for example in tilemap base maps this would be a tile
|
|
void | Show () |
| shows grid lines on the map
|
|
void | Hide () |
| hides grid lines on the map
|
|
virtual Vector3 | ClampPosition (Vector3 position) |
| clamps a position to be inside the maps size
if, for example, a position 5,-10 is passed for a map that starts at 0,0 the position will be clamped to 5,0
|
|
virtual Vector2Int | ClampPoint (Vector2Int point) |
| clamps a point to be inside the maps size
|
|
virtual Vector2Int | GetGridPosition (Vector3 position) |
| turns a world position into a map point
|
|
virtual Vector3 | GetWorldPosition (Vector2Int position) |
| turns a map point into the world position in its lower corner
|
|
virtual Vector3 | GetCenterFromPosition (Vector3 position) |
| calculates the cells center from its corner position
to get the cell center from any position in it use Extensions.GetWorldCenterPosition(IGridPositions, Vector3)
|
|
virtual Vector3 | GetPositionFromCenter (Vector3 center) |
| calculates the cells corner position from its center
|
|
virtual Vector3 | GetVariance () |
| get position variance for walkers and such, can be used so walkers on the same point dont overlap
|
|
virtual void | SetRotation (Transform transform, Vector3 direction) |
| adjusts a transform in order to visually reflect the direction it is facing
|
|
virtual void | SetRotation (Transform transform, float rotation) |
| adjusts a transform by a rotation in degrees
|
|
virtual float | GetRotation (Vector3 direction) |
| calculates a numeric rotation in degrees from a direction
|
|
virtual Vector3 | GetDirection (float angle) |
| calculates a direction from a numeric roation
|
|