示例#1
0
    public void Build()
    {
        initialEnemies = 0;

        TextAsset levelJson = Resources.Load <TextAsset>(filename);
        LevelData levelData = JsonUtility.FromJson <LevelData>(levelJson.text);

        gameObjects = new List <GameObject>();

        if (levelData.enemies != null)
        {
            foreach (EnemyCoords enemy in levelData.enemies)
            {
                S_Terrain.SpawnEnemy(S_Terrain.ParseCoords(enemy.coords), enemy.name);
                initialEnemies += 1;
            }
            enemiesN = initialEnemies;
        }

        if (levelData.height != null)
        {
            foreach (HeightCoords hdata in levelData.height)
            {
                //S_Terrain.RiseTile(hdata.coords, hdata.height);
                S_Terrain.SinkTile(S_Terrain.ParseCoords(hdata.coords));
                //S_Terrain.SpawnBlock(S_Terrain.ParseCoords(hdata.coords));
            }
        }
    }
示例#2
0
 public override void Action()
 {
     S_Terrain.SinkTile(S_Terrain.GetRandomCoordinates());
 }