Example #1
0
    TilemapGenerator SpawnChunk(int depth, int tunnelWidth, int startX)
    {
        TilemapGenerator tilemap = Instantiate(generatorPrefab, transform);

        tilemap.transform.position = new Vector3(0f, -depth * (ChunkHeight - 1));

        tilemap.Init(50, 100, 1, 3, 1, 30, 60);
        bool isSurface = (depth == 0);

        tilemap.GenerateTilemap(tunnelWidth, startX, isSurface);

        return(tilemap);
    }
 public void Init()
 {
     //Debug.Log("Map Init " + GetInstanceID());
     //mapSeed = worldGeneratorScript.random.Next();
     mapArrayGenerator.Init(worldGeneratorScript.random.Next());
     tilemapGenerator.Init(worldGeneratorScript.random.Next());
     foreach (SceneryGenerator sceneryGenerator in sceneryGenerators)
     {
         sceneryGenerator.Init(worldGeneratorScript.random.Next());
     }
     foreach (Side side in sides)
     {
         InitConnector(side);
     }
 }