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

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

+ Inheritance diagram for GraphModifier:
+ Collaboration diagram for GraphModifier:

Public Types

enum  EventType {
  PostScan, PreScan, LatePostScan, PreUpdate,
  PostUpdate, PostCacheLoad
}
 GraphModifier event type. More...
 

Public Member Functions

virtual void OnDisable ()
 Removes this modifier from list of active modifiers.
 
virtual void OnEnable ()
 Adds this modifier to list of active modifiers.
 
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 TriggerEvent (GraphModifier.EventType type)
 Triggers an event for all active graph modifiers.
 

Static Private Member Functions

static List< GraphModifierGetActiveModifiers ()
 Returns all active graph modifiers in the scene.
 

Static Private Attributes

static List< GraphModifieractiveModifiers = new List<GraphModifier>()
 All active graph modifiers.
 
static int lastLateScanEvent = -9999
 Last frame a late scan event was triggered.
 
static int lastPostCacheEvent = -9999
 Last frame a post cache event was triggered.
 

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

Member Enumeration Documentation

enum EventType

GraphModifier event type.

See Also
GraphModifier

Member Function Documentation

virtual void OnEnable ( )
virtual

Adds this modifier to list of active modifiers.

Calls OnLatePostScan if the last late post scan event was triggered during this frame.

+ Here is the call graph for this function:

virtual void OnGraphsPostUpdate ( )
virtual

Called after graphs have been updated using GraphUpdateObjects.

Eventual flood filling has been done

+ Here is the caller graph for this function:

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.

+ Here is the caller graph for this function:

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.

+ Here is the caller graph for this function:

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.

+ Here is the caller graph for this function:

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

+ Here is the caller graph for this function:


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