Pathfinding.GraphModifier.TriggerEvent C# (CSharp) Method

TriggerEvent() public static method

public static TriggerEvent ( GraphModifier type ) : void
type GraphModifier
return void
		public static void TriggerEvent (GraphModifier.EventType type) {
			
			if (!Application.isPlaying) {
				FindAllModifiers ();
			}
			
			GraphModifier c = root;
			switch (type){
			case EventType.PreScan:
					while (c != null) { c.OnPreScan(); c = c.next; }
					break;
			case EventType.PostScan:
					while (c != null) { c.OnPostScan(); c = c.next; }
					break;
			case EventType.LatePostScan:
					while (c != null) { c.OnLatePostScan(); c = c.next; }
					break;
			case EventType.PreUpdate:
					while (c != null) { c.OnGraphsPreUpdate(); c = c.next; }
					break;
			case EventType.PostUpdate:
					while (c != null) { c.OnGraphsPostUpdate(); c = c.next; }
					break;
			case EventType.PostCacheLoad:
					while (c != null) { c.OnPostCacheLoad(); c = c.next; }
					break;
			}
		}
		

Usage Example

Ejemplo n.º 1
0
        /** Load from data from #file_cachedStartup */
        public void LoadFromCache()
        {
            var graphLock = AssertSafe();

            if (file_cachedStartup != null)
            {
                var bytes = file_cachedStartup.bytes;
                DeserializeGraphs(bytes);

                GraphModifier.TriggerEvent(GraphModifier.EventType.PostCacheLoad);
            }
            else
            {
                Debug.LogError("Can't load from cache since the cache is empty");
            }
            graphLock.Release();
        }
All Usage Examples Of Pathfinding.GraphModifier::TriggerEvent