Example #1
0
        public void GenerateWorldManually(Pathfinder _pathfinder, List <Tile[][]> tileGrids, List <IntVector2> tileGridOffset, bool autoConnectWorldAreas)
        {
            worldCreatedManually = true;

            pathfinder = _pathfinder;
            float startTime = Time.realtimeSinceStartup;

            tileManager.worldData = multiLevelSectorManager.worldData = hierachalPathfinder.worldData = intergrationFieldManager.worldData = flowFieldManager.worldData = this;
            multiLevelSectorManager.lowLevel.manager = multiLevelSectorManager.highLevel.manager = multiLevelSectorManager;
            worldPositionOffset = new Vector3(0, pathfinder.generationClimbHeight * 0.15f, 0);

            worldBuilder.gridWidth  = (int)(pathfinder.worldWidth / pathfinder.tileSize);
            worldBuilder.gridLength = (int)(pathfinder.worldLength / pathfinder.tileSize);



            worldBuilder.GenerateWorldManually(this, tileGrids, tileGridOffset, autoConnectWorldAreas);


            worldGenerated = true;
            float endTime     = Time.realtimeSinceStartup;
            float timeElapsed = (endTime - startTime);

            Debug.Log("timeElapsed Generate World ms: " + (timeElapsed * 1000f).ToString());
        }
Example #2
0
        public void GenerateWorldManually(Pathfinder pathfinder, List <Tile[][]> tileGrids,
                                          List <IntVector2> tileGridOffset, bool autoConnectWorldAreas)
        {
            WorldCreatedManually = true;

            Pathfinder = pathfinder;

            TileManager.WorldData = MultiLevelSectorManager.WorldData = HierarchicalPathfinder.WorldData =
                IntegrationFieldManager.WorldData         = FlowFieldManager.WorldData = this;
            MultiLevelSectorManager.LowLevel.Manager      =
                MultiLevelSectorManager.HighLevel.Manager = MultiLevelSectorManager;

            WorldBuilder.GridWidth  = (int)(Pathfinder.worldWidth / Pathfinder.tileSize);
            WorldBuilder.GridLength = (int)(Pathfinder.worldLength / Pathfinder.tileSize);

            WorldBuilder.GenerateWorldManually(this, tileGrids, tileGridOffset, autoConnectWorldAreas);

            WorldGenerated = true;
        }