示例#1
0
    private void GenerateWorld(bool useRSeed)
    {
        if (useRSeed)
        {
            seed = System.DateTime.Now.ToString();
        }

        GameTiles.BuildTilesDict(groundTilemap);


        Random.InitState(seed.GetHashCode());

        var env = ScriptableObject.CreateInstance <EnvironmentBuilder>();

        env.wallObject = wallObject;
        env.numWalls   = numWalls;
        env.SpawnWalls();

        var spawner = ScriptableObject.CreateInstance <Spawner>();

        spawner.playerObject = playerObject;
        spawner.enemyObject  = enemyObject;
        spawner.numEnemies   = numEnemies;
        spawner.SpawnPlayer();
        spawner.SpawnEnemies();
        PathGrid.BuildGrid();
    }