walks to the closest attackable and attacks it periodically until it is dead, rinse and repeat
https://citybuilder.softleitner.com/manual/attacks
|
override void | Initialize (BuildingReference home, Vector2Int start) |
| called right after instantiating or reactivating a walker
buildings have not had a chance to interact with the walker
when your logic needs something from outside first override Spawned instead
|
|
void | Recalculate () |
|
void | Hurt (int damage) |
| damages and potentially kills the attacker
|
|
override string | GetDebugText () |
| returns text that gets displayed for debugging in the scene editor
|
|
override string | SaveData () |
| serializes the objects state(usually to json) and returns it
|
|
override void | LoadData (string json) |
| deserializes the serialized json data and loads the data as its new state
|
|
virtual void | Spawned () |
| called after the walker is fully initialized and its spawning has been signaled to the owner
|
|
void | StartProcess (WalkerAction[] actions, string key=null) |
| starts a series of WalkerActions as a process
the actions will be executed in order until the end is reached if another process is already running it is cancelled
|
|
void | AdvanceProcess () |
| mvoes the process to the next action or finishes it when the last action is finished
|
|
void | CancelProcess () |
| requests for the current process to be cancelled
|
|
void | roam (int memoryLength, int range, PathType pathType, UnityEngine.Object pathTag, Action finished=null) |
| walker starts walking around semi randomly, visited points are memorized and avoided
|
|
void | roam (int memoryLength, int range, Action finished=null) |
| walker starts walking around semi randomly, visited points are memorized and avoided
|
|
void | roam (float delay, int memoryLength, int range, Action finished=null) |
| walker starts walking around semi randomly after waiting for a set duration, visited points are memorized and avoided
|
|
void | continueRoam (int memoryLength, int range, Action finished) |
| continues roaming when the game is loaded and the walker was roaming previously uses the default pathing defined in the walkers inspector to get points
|
|
void | continueRoam (int memoryLength, int range, PathType pathType, UnityEngine.Object pathTag, Action finished) |
| continues roaming when the game is loaded and the walker was roaming previously uses the pathing passed in the parameters to get points
|
|
void | cancelRoam () |
| requests for the current roaming to be stopped, will not happen immediately but when the next point is reached
|
|
bool | walk (IBuilding target, Action finished=null) |
| tries to walk to a building using default pathing defined in the inspector
|
|
bool | walk (Vector2Int target, Action finished=null) |
| tries to walk to a specific point using default pathing defined in the inspector
|
|
bool | walk (Vector2Int target, PathType pathType, UnityEngine.Object pathTag, Action finished=null) |
| tries to walk to a specific point using the pathing passed in the parameters
|
|
void | walk (WalkingPath path, Action finished=null) |
| starts walking a set walking path
|
|
void | walk (WalkingPath path, float delay, Action finished=null) |
| starts walking a set walking path
|
|
void | continueWalk (Action finished=null) |
| when the game is loaded and the walker was previously walking it is continued here
|
|
void | cancelWalk () |
| stops the current walking, walking may not stop immediately but rather when the walker reaches the next full point
|
|
void | wander (Action finished) |
| starts walking to a random neighbouring point if one is available
|
|
void | continueWander (Action finished) |
| when the game is loaded and the walker was previously wandering it is continued here
|
|
void | wait (Action finished, float time) |
| starts waiting for a set duration
|
|
void | delay (Action finished) |
| waits for the duration configured in WalkerInfo.Delay
|
|
void | continueWait (Action finished) |
| when the game is loaded and the walker was previously waiting it is continued here
|
|
void | cancelWait () |
| cancels waiting, remaining time is set to 0 and finished is called
|
|
void | Hide () |
| hides the walker by deactivating its pivot and disableing its collider
|
|
void | Show () |
| hides the walker by activating its pivot and enableing its collider
|
|
void | Finish () |
| Removes the walker from the map(when it has done its job or died for example)
|
|
virtual string | GetName () |
|
virtual string | GetDescription () |
| gets displayed in dialogs to show the walker description to players
|
|
T | AddAddon< T > (T prefab) |
| adds and initializes an addon onto the walker from a prefab
|
|
T | GetAddon< T > (T _) |
| get the first addon of the specified type
|
|
T | GetAddon< T > (string key) |
| get the first addon with the specified key
|
|
bool | HasAddon< T > () |
| checks if a certain addon type is present on the walker
|
|
bool | HasAddon< T > (T _) |
| checks if a certain addon type is present on the walker
|
|
bool | HasAddon (string key) |
| checks if an addon with a specific key is present on the walker
|
|
void | RemoveAddon (WalkerAddon addon) |
| terminates and removes an addon from the walker
|
|
bool | RemoveAddon (string key) |
| terminates and removes an addon from the building with the given key or returns false if none were found
|
|
virtual void | OnMessages (string e) |
| use when a single string has to be split into several messages
by default the parameter is split by spaces
|
|
virtual void | OnMessage (string e) |
| puts a message into the characters messaging pipeline
|
|
|
override void | Start () |
|
override void | OnDestroy () |
|
virtual void | onProcessFinished (ProcessState process) |
| called when the current process is finished, may be overridden to look for something else to do(for example in the town demo)
|
|
virtual void | onMoved (Vector2Int point) |
| called whenever movement reaches a point in its path
these are corner points in regular movement and every path point when roaming
|
|
virtual void | onFinished () |
| called to remove the walker from the map when it has done its job(or died)
|
|
void | followPath (IEnumerable< Vector3 > path, Action finished) |
| starts walking a set series of points
|
|
void | followPath (IEnumerable< Vector3 > path, float delay, Action finished) |
| starts walking a set walking path
|
|
void | continueFollow (Action finished) |
| continues following a path when a game is loaded and the walker was previously doing so
|
|
void | tryWalk (IBuilding target, float delay, Action planned=null, Action finished=null, Action canceled=null) |
| tries to walk to a building, if no path is found the walker waits a second and retries until WalkerInfo.MaxWait times it out
|
|
void | tryWalk (Vector2Int target, float delay, Action planned=null, Action finished=null, Action canceled=null) |
| tries to walk to a point, if no path is found the walker waits a second and retries until WalkerInfo.MaxWait times it out
|
|
void | tryWalk (Func< WalkingPath > pathGetter, float delay, Action planned=null, Action finished=null, Action canceled=null) |
| tries to walk a path that is calculated externaly, if no path is found the walker waits a second and retries until WalkerInfo.MaxWait times it out
|
|
void | tryWalk (IBuilding target, Action planned=null, Action finished=null, Action canceled=null) |
| tries to walk to a building, if no path is found the walker waits a second and retries until WalkerInfo.MaxWait times it out
|
|
void | tryWalk (Vector2Int target, Action planned=null, Action finished=null, Action canceled=null) |
| tries to walk to a point, if no path is found the walker waits a second and retries until WalkerInfo.MaxWait times it out
|
|
void | tryWalk (Func< WalkingPath > pathGetter, Action planned=null, Action finished=null, Action canceled=null) |
| tries to walk a path that is calculated externaly, if no path is found the walker waits a second and retries until WalkerInfo.MaxWait times it out
|
|
void | tryWalk (Func< PathQuery > queryGetter, Action planned=null, Action finished=null, Action canceled=null) |
| tries to walk a path that is calculated externaly using a query, if no path is found the walker waits a second and retries until WalkerInfo.MaxWait times it out
|
|
void | tryWalk (Func< PathQuery > queryGetter, float delay, Action planned=null, Action finished=null, Action canceled=null) |
| tries to walk a path that is calculated externaly using a query, if no path is found the walker waits a second and retries until WalkerInfo.MaxWait times it out
|
|
void | tryWalk< T > (Func< BuildingComponentPathQuery< T > > queryGetter, Action< BuildingComponentPath< T > > planned=null, Action finished=null, Action canceled=null) |
| tries to walk a path to a component that is calculated externaly using a query, if no path is found the walker waits a second and retries until WalkerInfo.MaxWait times it out
|
|
void | tryWalk< T > (Func< BuildingComponentPathQuery< T > > queryGetter, float delay, Action< BuildingComponentPath< T > > planned=null, Action finished=null, Action canceled=null) |
| tries to walk a path to a component that is calculated externaly using a query, if no path is found the walker waits a second and retries until WalkerInfo.MaxWait times it out
|
|
void | tryWalk< Q, P > (Func< Q > preparer, Func< Q, P > planner, Func< P, WalkingPath > planned, Action finished=null, Action canceled=null) |
| tries to walk a path that created in a two step process, if no path is found the walker waits a second and retries until WalkerInfo.MaxWait times it out
|
|
void | tryWalk< Q, P > (Func< Q > preparer, Func< Q, P > planner, Func< P, WalkingPath > planned, float delay, Action finished=null, Action canceled=null) |
| tries to walk a path that created in a two step process, if no path is found the walker waits a second and retries until WalkerInfo.MaxWait times it out
|
|
string | getDescription (int index) |
| returns a specific description that may explain the current walker status
|
|
string | getDescription (int index, params object[] parameters) |
| returns a specific description that may explain the current walker status with placeholders replaced by specified parameters
for example 'delivering {1} to {2} from {0}' where 0 is the home building name, 1 is the item name and 2 is the target building(DeliveryWalker in ThreeDemo)
|
|
WalkerData | savewalkerData () |
|
void | loadWalkerData (WalkerData data) |
|
|
override float | Speed [get] |
|
Vector3 | Position [get] |
| position for defenders to attack
|
|
float | TotalHealth [get] |
| maximum health the entity can have
|
|
float | CurrentHealth [get] |
| current health the entity has
|
|
Vector3 | HealthPosition [get] |
| the absolute world position that the health bar should be displayed at
|
|
Guid | Id = Guid.NewGuid() [get, set] |
| unique walker identifier that is also persisted, can be used to save references to walkers
|
|
BuildingReference | Home [get, set] |
| reference to the building the walker was spawned from, if any
|
|
ProcessState | CurrentProcess [get, set] |
| returns the current ProcessState if a process is currently active
|
|
ProcessState | NextProcess [get, set] |
| the process that will be started when the current one finishes
is used when a process is started when another one is still running
|
|
RoamingState | CurrentRoaming [get, set] |
| returns the current RoamingState if the walker is currently roaming
|
|
WalkingState | CurrentWalking [get, set] |
| returns the current WalkingState if the walker is currently walking
|
|
WalkingAgentState | CurrentAgentWalking [get, set] |
| returns the current WalkingState if the walker is currently walking using a navmesh agent
|
|
WaitingState | CurrentWaiting [get, set] |
| returns the current WaitingState if the walker is currently waiting
|
|
float? | HeightOverride [get, set] |
| height that the entity is forced to have, null to use the regular height(terrain or road height)
|
|
Vector2Int | CurrentPoint [get] |
| last map point the walker has finished moving to, used whenever a new path needs to be found or just to check where the walker is
|
|
Vector2Int | GridPoint [get] |
| map point the walker is currently positioned on by absolute position
|
|
virtual float | Speed [get] |
|
virtual PathType | PathType [get] |
|
virtual UnityEngine.Object | PathTag [get] |
| optional parameter for pathfinding, depends on PathType
for example a road for road pathing to only walk on that specific road
|
|
virtual ItemStorage | ItemStorage [get] |
| item storage of the walker if there is one
|
|
WalkerAction | CurrentAction [get] |
| currently active action when a process is running
|
|
bool | IsWalking [get, set] |
| whether the walker is currently moving(roaming, walking or agent walking)
|
|
IReadOnlyCollection< WalkerAddon > | Addons [get] |
| currently active WalkerAddons on this walker
|
|