Loading...
Searching...
No Matches
CityBuilderCore.OffGridLink Class Reference

Detailed Description

creates a link between two points in grid and road pathfinding
grid links are the grid pathfinding equivalent to off mesh links in navmesh
basically a grid link registers a link between two points in the pathfinding
when moving between these two points the linker determines how a walker moves
this can be used for special movement on bridges, ramps, ...

https://citybuilder.softleitner.com/manual/walkers

Inheritance diagram for CityBuilderCore.OffGridLink:
CityBuilderCore.IGridLink CityBuilderCore.ExpandableOffGridLink

Public Member Functions

void Reregister ()
 
virtual void Walk (Walker walker, float moved, Vector2Int start)
 walker movement is done here while a walker is traversing a link
this can be used to move walkers in atypical ways
for example when moving up ramps or across bridges
 

Public Attributes

bool Bidirectional = true
 
int Cost = 10
 
float Distance = 2
 
Transform StartTransform
 
Transform EndTransform
 
Transform[] Path
 
bool LinkRoad = true
 
bool LinkMapGrid = true
 
Object Tag
 

Protected Member Functions

virtual void Start ()
 
virtual void Update ()
 
virtual void OnDestroy ()
 
virtual void OnDrawGizmosSelected ()
 
virtual void register ()
 
virtual void deregister ()
 
virtual void initialize ()
 
virtual int getCost ()
 
virtual float getDistance ()
 

Properties

Vector2Int StartPoint [get]
 start point of the link, if it changes the link has to be reregistered
 
Vector2Int EndPoint [get]
 end point of the link, if it changes the link has to be reregistered
 
Vector3 StartPosition [get]
 
Vector3 EndPosition [get]
 

Member Function Documentation

◆ Walk()

virtual void CityBuilderCore.OffGridLink.Walk ( Walker walker,
float moved,
Vector2Int start )
inlinevirtual

walker movement is done here while a walker is traversing a link
this can be used to move walkers in atypical ways
for example when moving up ramps or across bridges

Parameters
walkerthe walker moving across the link
movedhow much the walker has already moved
startthe point the walker started at, relevant in bidirectional links

Implements CityBuilderCore.IGridLink.

Reimplemented in CityBuilderCore.ExpandableOffGridLink.

Property Documentation

◆ EndPoint

Vector2Int CityBuilderCore.OffGridLink.EndPoint
get

end point of the link, if it changes the link has to be reregistered

Implements CityBuilderCore.IGridLink.

◆ StartPoint

Vector2Int CityBuilderCore.OffGridLink.StartPoint
get

start point of the link, if it changes the link has to be reregistered

Implements CityBuilderCore.IGridLink.