Пример #1
0
    void Awake()
    {
        gameManager    = GameObject.FindObjectOfType <GameManager>();
        enemiesManager = GameObject.FindObjectOfType <EnemiesManager>();

        for (int i = 0; i < lines; i++)
        {
            enemies.Add(new List <GameObject>());
            for (int j = 0; j < columns; j++)
            {
                enemies[i].Add(typeEnemies[defineType[gameManager.stage, i, j]]);
                Instantiate(enemies[i][j], transform.position + new Vector3(j * horizontalSpace, i * -verticalSpace, 0), Quaternion.identity, gameObject.transform);
            }
        }

        enemiesManager.Setup();
    }