ClassicCityBuilderKit 1.9.0
|
Public Member Functions | |
bool | IsInside (Vector2Int point) |
checks if a point is inside the map size | |
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 | |
bool | IsWalkable (Vector2Int point) |
check if a point can be walked on and may be used in pathfinding | |
bool | CheckGround (Vector2Int point, 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 | |
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 | |
Vector2Int | ClampPoint (Vector2Int point) |
clamps a point to be inside the maps size | |
Vector2Int | GetGridPoint (Vector3 position) |
turns a world position into a map point | |
Vector3 | GetWorldPosition (Vector2Int point) |
turns a map point into the world position in its lower corner(without height) | |
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) | |
Vector3 | GetPositionFromCenter (Vector3 center) |
calculates the cells corner position from its center | |
Vector3 | GetVariance () |
get position variance for walkers and such, can be used so walkers on the same point dont overlap | |
void | SetRotation (Transform transform, Vector3 direction) |
adjusts a transform in order to visually reflect the direction it is facing | |
void | SetRotation (Transform transform, float rotation) |
adjusts a transform by a rotation in degrees | |
float | GetRotation (Vector3 _) |
calculates a numeric rotation in degrees from a direction | |
Vector3 | GetDirection (float _) |
calculates a direction from a numeric roation | |
Public Attributes | |
Vector2Int | Size |
Tilemap | Ground |
TileBase[] | WalkingBlockingTiles |
TileBase[] | BuildingBlockingTiles |
MeshRenderer | GridVisual |
Protected Member Functions | |
virtual void | Awake () |
Properties | |
bool | IsHex [get] |
whether we're on a hexagonal map which may need some special handling | |
bool | IsXY [get] |
whether the map grid is in xy, usually in 2d games 3d games often use Y as the height axis and have their grid in XZ | |
Vector3 | CellOffset [get] |
delta position from one cell to the next | |
Vector3 | WorldCenter [get] |
world position at the center of the map | |
Vector3 | WorldSize [get] |
Grid | Grid [get] |
Properties inherited from CityBuilderCore.IMap |
|
inline |
checks the ground for certain features
for example in tilemap base maps this would be a tile
point | the point on the map to check |
options | a set of features that would be acceptable |
Implements CityBuilderCore.IMap.
|
inline |
clamps a point to be inside the maps size
point | a point that may or may not be inside the map |
Implements CityBuilderCore.IMap.
|
inline |
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
position | the position to check |
Implements CityBuilderCore.IMap.
|
inline |
calculates the cells center from its corner position
to get the cell center from any position in it use Extensions.GetWorldCenterPosition(IGridPositions, Vector3)
position | absolute world space position of the cell cornder |
Implements CityBuilderCore.IGridPositions.
Vector3 CityBuilderCore.Tests.DebugMap.GetDirection | ( | float | angle | ) |
calculates a direction from a numeric roation
angle | rotation indegrees |
Implements CityBuilderCore.IGridRotations.
|
inline |
turns a world position into a map point
position | absolute world space position(transform.position) |
Implements CityBuilderCore.IGridPositions.
|
inline |
calculates the cells corner position from its center
center | absolute world space position of the cell center |
Implements CityBuilderCore.IGridPositions.
float CityBuilderCore.Tests.DebugMap.GetRotation | ( | Vector3 | direction | ) |
calculates a numeric rotation in degrees from a direction
direction | direction the object is facing |
Implements CityBuilderCore.IGridRotations.
|
inline |
get position variance for walkers and such, can be used so walkers on the same point dont overlap
Implements CityBuilderCore.IMap.
|
inline |
turns a map point into the world position in its lower corner(without height)
point | map/cell point |
Implements CityBuilderCore.IGridPositions.
void CityBuilderCore.Tests.DebugMap.Hide | ( | ) |
hides grid lines on the map
Implements CityBuilderCore.IGridOverlay.
|
inline |
checks if a point is ok to build on or if the map somehow blocks building there
point | the point on the map to check |
mask | the structure levels to check, 0 for all |
Implements CityBuilderCore.IMap.
|
inline |
checks if a point is inside the map size
point | the point to check |
Implements CityBuilderCore.IMap.
|
inline |
check if a point can be walked on and may be used in pathfinding
point | the point to check |
Implements CityBuilderCore.IMap.
|
inline |
adjusts a transform by a rotation in degrees
transform | the transform that will be chaned |
rotation | the rotation in degrees |
Implements CityBuilderCore.IGridRotations.
|
inline |
adjusts a transform in order to visually reflect the direction it is facing
transform | the transform that will be changed |
direction | the direction the entity moves or looks at |
Implements CityBuilderCore.IGridRotations.
void CityBuilderCore.Tests.DebugMap.Show | ( | ) |
shows grid lines on the map
Implements CityBuilderCore.IGridOverlay.
|
get |
delta position from one cell to the next
Implements CityBuilderCore.IMap.
|
get |
whether we're on a hexagonal map which may need some special handling
Implements CityBuilderCore.IMap.
|
get |
whether the map grid is in xy, usually in 2d games
3d games often use Y as the height axis and have their grid in XZ
Implements CityBuilderCore.IMap.
|
get |
world position at the center of the map
Implements CityBuilderCore.IMap.