Loading...
Searching...
No Matches
CityBuilderCore.IGridHeights Interface Reference

Detailed Description

optional interface that adjusts the height of entities on the map
the DefaultMapHeight implementation does this by moving them up and down which makes sense for 3d games
2d games can ignore this entirely or perhaps add an implementation that scales entities a little bit

Inheritance diagram for CityBuilderCore.IGridHeights:
CityBuilderCore.DefaultMapHeight CityBuilderCore.LayerMapHeight

Public Member Functions

float GetHeight (Vector3 position, PathType pathType=PathType.Map)
 calculates height at given world position
 
void ApplyHeight (Transform transform, Vector3 position, PathType pathType=PathType.Map, float? overrideValue=null)
 applies heigth to the passed transform
the transforms position may be used to calculate the height
 

Member Function Documentation

◆ ApplyHeight()

void CityBuilderCore.IGridHeights.ApplyHeight ( Transform transform,
Vector3 position,
PathType pathType = PathType.Map,
float? overrideValue = null )

applies heigth to the passed transform
the transforms position may be used to calculate the height

Parameters
transformthe transform that will be changed
pathTypeheight may be different when moving on a road for example
overrideValueregular height calculation may not always apply, for example on bridges(which use IOverrideHeight)

Implemented in CityBuilderCore.DefaultMapHeight, and CityBuilderCore.LayerMapHeight.

◆ GetHeight()

float CityBuilderCore.IGridHeights.GetHeight ( Vector3 position,
PathType pathType = PathType.Map )

calculates height at given world position

Parameters
positionabsolute world position
pathTypeheight may be different when moving on a road for example
Returns
height at position or 0 if height cannot be represented by a number(layer height for example)

Implemented in CityBuilderCore.DefaultMapHeight, and CityBuilderCore.LayerMapHeight.