A* Pathfinding Project  3.6
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events Macros Groups Pages
GraphModifier Class Reference

GraphModifier for modifying graphs or processing graph data based on events. More...

Detailed Description

GraphModifier for modifying graphs or processing graph data based on events.

This class is a simple container for a number of events.

Warning
Some events will be called both in play mode and in editor mode (at least the scan events). So make sure your code handles both cases well. You may choose to ignore editor events.
See Also
Application.IsPlaying

Public Types

enum  EventType {
  PostScan = 1 << 0, PreScan = 1 << 1, LatePostScan = 1 << 2, PreUpdate = 1 << 3,
  PostUpdate = 1 << 4, PostCacheLoad = 1 << 5
}
 GraphModifier event type. More...
 

Public Member Functions

virtual void OnGraphsPostUpdate ()
 Called after graphs have been updated using GraphUpdateObjects.
 
virtual void OnGraphsPreUpdate ()
 Called before graphs are updated using GraphUpdateObjects.
 
virtual void OnLatePostScan ()
 Called at the end of the scanning procedure.
 
virtual void OnPostCacheLoad ()
 Called after cached graphs have been loaded.
 
virtual void OnPostScan ()
 Called right after all graphs have been scanned.
 
virtual void OnPreScan ()
 Called right before graphs are going to be scanned.
 

Static Public Member Functions

static void FindAllModifiers ()
 
static void TriggerEvent (GraphModifier.EventType type)
 Triggers an event for all active graph modifiers.
 

Protected Member Functions

virtual void OnDisable ()
 Removes this modifier from list of active modifiers.
 
virtual void OnEnable ()
 Adds this modifier to list of active modifiers.
 

Private Attributes

GraphModifier next
 
GraphModifier prev
 

Static Private Attributes

static GraphModifier root
 All active graph modifiers.
 

Member Enumeration Documentation

enum EventType

GraphModifier event type.

See Also
GraphModifier
Enumerator:
PostScan 
PreScan 
LatePostScan 
PreUpdate 
PostUpdate 
PostCacheLoad 

Member Function Documentation

static void FindAllModifiers ( )
static
virtual void OnDisable ( )
protectedvirtual

Removes this modifier from list of active modifiers.

Reimplemented in NodeLink3, and NodeLink2.

virtual void OnEnable ( )
protectedvirtual

Adds this modifier to list of active modifiers.

Reimplemented in NodeLink3, and NodeLink2.

virtual void OnGraphsPostUpdate ( )
virtual

Called after graphs have been updated using GraphUpdateObjects.

Eventual flood filling has been done

Reimplemented in NodeLink3, NodeLink2, and NodeLink.

virtual void OnGraphsPreUpdate ( )
virtual

Called before graphs are updated using GraphUpdateObjects.

virtual void OnLatePostScan ( )
virtual

Called at the end of the scanning procedure.

This is the absolute last thing done by Scan.

Note
This event will be called even if Script Execution Order has messed things up (see the other two scan events).

Reimplemented in RVONavmesh.

virtual void OnPostCacheLoad ( )
virtual

Called after cached graphs have been loaded.

When using cached startup, this event is analogous to OnLatePostScan and implementing scripts should do roughly the same thing for both events.

Note
This event will be called even if Script Execution Order has messed things up (see the other two scan events).

Reimplemented in RVONavmesh.

virtual void OnPostScan ( )
virtual

Called right after all graphs have been scanned.

FloodFill and other post processing has not been done.

Warning
Since OnEnable and Awake are called roughly in the same time, the only way to ensure that these scripts get this call when scanning in Awake is to set the Script Execution Order for AstarPath to some time later than default time (see Edit -> Project Settings -> Script Execution Order).
See Also
OnLatePostScan

Reimplemented in GraphUpdateScene, NodeLink3, NodeLink2, and NodeLink.

virtual void OnPreScan ( )
virtual

Called right before graphs are going to be scanned.

Warning
Since OnEnable and Awake are called roughly in the same time, the only way to ensure that these scripts get this call when scanning in Awake is to set the Script Execution Order for AstarPath to some time later than default time (see Edit -> Project Settings -> Script Execution Order).
See Also
OnLatePostScan
static void TriggerEvent ( GraphModifier.EventType  type)
static

Triggers an event for all active graph modifiers.

Member Data Documentation

GraphModifier next
private
GraphModifier prev
private
GraphModifier root
staticprivate

All active graph modifiers.


The documentation for this class was generated from the following file: