//all this awesome pipeline //threaded public override void Work() { if (profiler != null) { profiler.AddLog("start thread", Color.green); profiler.StartThreadStuff(); } if (stop) { if (profiler != null) { profiler.Abort(); } return; } VolumeContainer volumes = new VolumeContainer(this); if (profiler != null) { profiler.AddLog("start collecting volumes", Color.green); } _terrainCollector.Collect(volumes); if (profiler != null) { profiler.AddLog("terrain collected"); } _primitivesCollector.Collect(volumes); if (profiler != null) { profiler.AddLog("collected"); } hashData = PathFinder.CloneHashData(); if (stop) { if (profiler != null) { profiler.Abort(); } return; } if (profiler != null) { profiler.AddLog("volumes container start doing stuff"); } volumes.DoStuff(); if (profiler != null) { profiler.AddLog("volumes container end doing stuff"); } if (stop) { if (profiler != null) { profiler.Abort(); } return; } if (profiler != null) { profiler.AddLog("graph generator start doing stuff", Color.green); } GraphGenerator generator = new GraphGenerator(volumes, this); Graph graph = generator.MakeGraph(); if (profiler != null) { profiler.AddLog("graph generator end making graph"); } if (stop) { if (profiler != null) { profiler.Abort(); } return; } if (profiler != null) { profiler.AddLog("end thread", Color.green); profiler.EndThreadStuff(); profiler.EndProfile(); profiler.DebugLog(ProfilderLogMode.log); } GC.Collect(); //Graph graph = new Graph(chunk, properties); if (onEndCallBack != null) { onEndCallBack.Invoke(graph); } }