Exemple #1
0
    void Start()
    {
        levelGenerator = new SimpleGenerator(floorTiles, wallTiles, numberOfTiles);

        map          = levelGenerator.Generate();
        objectPlacer = new SimpleObjectPlacer(levelGenerator.GetTiles());

        objectPlacer.PlacePlayer(player);
        enemies = objectPlacer.PlaceEnemies(enemiesPrefabs, 1);
        objectPlacer.PlaceObject(medKitPrefab);
        objectPlacer.PlaceObject(bodyArmourPrefab);
        objectPlacer.PlaceObject(ammoBoxPrefab);
        List <Tile> path = getPath(enemies[0]);

        if (path.Count > 1)
        {
            path.Reverse();
            enemies[0].GetComponent <Enemy>().SetPath(path);
        }
    }