Exemplo n.º 1
0
    // private const int _ROW_ = 15;
    // private const int _COLUMN_ = 15;

    private void Awake()
    {
        state = State.Idle;

        dungeonManager = GameObject.Find("DungeonManager");

        DungeonMapRandomBuilder mapBuilder =
            dungeonManager.GetComponent <DungeonMapRandomBuilder>();

        levelInformation = mapBuilder.LevelInformation;

        enemyTypes = levelInformation.listEnemies.ToArray();
        enemies    =
            new GameObject[Random.Range(_MIN_ENEMY_NUMBER_, _MAX_ENEMY_NUMBER_ + 1)];
        enemyEvents = new Enemy[enemies.Length];

        for (int i = 0, size = enemies.Length; i < size; i++)
        {
            enemies[i] = enemyTypes[Random.Range(0, enemyTypes.Length)];
        }

        boss = levelInformation.boss;

        roomBuilder = room.GetComponent <DungeonRoomBuilder>();
    }
Exemplo n.º 2
0
 private void Awake()
 {
     roomBuilder = room.GetComponent <DungeonRoomBuilder>();
 }