public void OnPopulateZones(PopulateZonesPlayingEvent evt) { if (isActive != _wasActive) // if our active state has changed, it means we are awaiting for the fact this has hapenned to be picked up in the TileHandlerHelper Update { lastPosition = tr.position; // set this here so TileHandlerHelper picks up the activity change, and not the movement, so NotifyUpdated() will not flag // this cuts obstacles as dynamic } RVOContourObstacle cutObstacle = GetRVOContourObstacle(); cutObstacle.OnLatePostScan(AStarPathfindingUtils.GetSimulator()); }
public void OnPopulateZones(PopulateZonesPlayingEvent evt) { if (scanOnStartup && AStarPathfindingUtils.WillNavMeshBeBuiltFromInputMeshOnLevelBegin()) { if (!astarData.cacheStartup || astarData.data_cachedStartup == null) { LevelHelper helper = GameObject.FindObjectOfType(typeof(LevelHelper)) as LevelHelper; if (helper != null) { AStarPathfindingUtils.CreateRecastNavMeshForInputMeshes(helper.transform.Find(ZoneHelper.ZonesRootName), helper.isOverworldNavMeshRequired); Scan(); EventManager.instance.Raise(new NavMeshScanEvent()); } } } if (Application.isPlaying) { RecastGraph.DestroyWalkableAreaObjects(); // we don't need the instances of AStarPathfindingWalkableArea in the game after this point RecastGraph.DestroyRecastMeshObjComponents(); // RecastMeshObj's are only used for nav mesh generation, they are not needed after this point AStarPathfindingRecastCut.DestroyRecastCutObjects(); AStarPathfindingGenerationTimeGeo.DestroyGenerationTimeGeoObjects(); } }