A* Pathfinding Project
4.3.8
The A* Pathfinding Project for Unity 3D
|
GraphModifier is used for modifying graphs or processing graph data based on events. More...
GraphModifier is used for modifying graphs or processing graph data based on events.
This class is a simple container for a number of events.
{graph_events.png}
Public Types | |
enum | EventType { PostScan = 1 << 0, PreScan = 1 << 1, LatePostScan = 1 << 2, PreUpdate = 1 << 3, PostUpdate = 1 << 4, PostCacheLoad = 1 << 5, PostUpdateBeforeAreaRecalculation = 1 << 6, PostGraphLoad = 1 << 7 } |
GraphModifier event type. More... | |
Public Member Functions | |
virtual void | OnGraphsPostUpdate () |
Called after graphs have been updated using GraphUpdateObjects or navmesh cutting. More... | |
virtual void | OnGraphsPostUpdateBeforeAreaRecalculation () |
Called after graphs have been updated. More... | |
virtual void | OnGraphsPreUpdate () |
Called before graphs are updated using GraphUpdateObjects. More... | |
virtual void | OnLatePostScan () |
Called at the end of the scanning procedure. More... | |
virtual void | OnPostCacheLoad () |
Called after cached graphs have been loaded. More... | |
virtual void | OnPostGraphLoad () |
Called after a graph has been deserialized and loaded. More... | |
virtual void | OnPostScan () |
Called right after all graphs have been scanned. More... | |
virtual void | OnPreScan () |
Called right before graphs are going to be scanned. More... | |
Static Public Member Functions | |
static void | FindAllModifiers () |
static void | TriggerEvent (GraphModifier.EventType type) |
Triggers an event for all active graph modifiers. More... | |
Protected Member Functions | |
override void | Awake () |
virtual void | OnDestroy () |
virtual void | OnDisable () |
Removes this modifier from list of active modifiers. More... | |
virtual void | OnEnable () |
Adds this modifier to list of active modifiers. More... | |
override void | Reset () |
Handle serialization backwards compatibility. More... | |
Protected Member Functions inherited from VersionedMonoBehaviour | |
virtual int | OnUpgradeSerializedData (int version, bool unityThread) |
Handle serialization backwards compatibility. More... | |
Static Protected Member Functions | |
static List< T > | GetModifiersOfType< T > () |
Protected Attributes | |
ulong | uniqueID |
Unique persistent ID for this component, used for serialization. More... | |
Static Protected Attributes | |
static Dictionary< ulong, GraphModifier > | usedIDs = new Dictionary<ulong, GraphModifier>() |
Maps persistent IDs to the component that uses it. More... | |
Private Member Functions | |
void | AddToLinkedList () |
void | ConfigureUniqueID () |
void | RemoveFromLinkedList () |
Private Attributes | |
GraphModifier | next |
GraphModifier | prev |
Static Private Attributes | |
static GraphModifier | root |
All active graph modifiers. More... | |
Additional Inherited Members | |
Properties inherited from VersionedMonoBehaviour | |
int Util.IEntityIndex. | EntityIndex [get, set] |
Internal entity index used by #BurstBatchHelper. More... | |
Properties inherited from IEntityIndex | |
int | EntityIndex [get, set] |
|
strong |
GraphModifier event type.
Enumerator | |
---|---|
PostScan | |
PreScan | |
LatePostScan | |
PreUpdate | |
PostUpdate | |
PostCacheLoad | |
PostUpdateBeforeAreaRecalculation | |
PostGraphLoad |
|
private |
|
protectedvirtual |
Reimplemented from VersionedMonoBehaviour.
Reimplemented in DynamicGridObstacle.
|
private |
|
static |
|
staticprotected |
T | : | GraphModifier |
|
protectedvirtual |
|
protectedvirtual |
Removes this modifier from list of active modifiers.
Reimplemented in NodeLink3, DynamicGridObstacle, NodeLink2, and RVONavmesh.
|
protectedvirtual |
|
virtual |
Called after graphs have been updated using GraphUpdateObjects or navmesh cutting.
This is among other times called after graphs have been scanned, updated using GraphUpdateObjects, navmesh cuts, or GraphUpdateScene components.
Area recalculations (see HierarchicalGraph) have been done at this stage so things like PathUtilities.IsPathPossible will work.
Use OnGraphsPostUpdateBeforeAreaRecalculation instead if you are modifying the graph in any way, especially connections and walkability. This is because if you do this then area recalculations
Reimplemented in RVONavmesh.
|
virtual |
Called after graphs have been updated.
This is among other times called after graphs have been scanned, updated using GraphUpdateObjects, navmesh cuts, or GraphUpdateScene components.
Use this if you are modifying any graph connections or walkability.
|
virtual |
Called before graphs are updated using GraphUpdateObjects.
|
virtual |
Called at the end of the scanning procedure.
This is the absolute last thing done by Scan.
Reimplemented in RVONavmesh.
|
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.
Reimplemented in RVONavmesh.
|
virtual |
Called after a graph has been deserialized and loaded.
This will be called often outside of play mode. Make sure to check Application.isPlaying if appropriate.
|
virtual |
Called right after all graphs have been scanned.
Reimplemented in GraphUpdateScene, NodeLink3, and DynamicGridObstacle.
|
virtual |
Called right before graphs are going to be scanned.
|
private |
|
protectedvirtual |
Handle serialization backwards compatibility.
Reimplemented from VersionedMonoBehaviour.
|
static |
Triggers an event for all active graph modifiers.
|
private |
|
private |
|
staticprivate |
All active graph modifiers.
|
protected |
Unique persistent ID for this component, used for serialization.
|
staticprotected |
Maps persistent IDs to the component that uses it.