Пример #1
0
 private void Update()
 {
     if (spawnCubes)
     {
         while (_cubeCount < cubeAmount)
         {
             MonoBehaviour cube = cubeFactory.GetNewInstance();
             cube.transform.SetPositionAndRotation(gameObject.transform.position, gameObject.transform.rotation);
             _cubeCount++;
         }
     }
     if (spawnEnemies)
     {
         while (_enemyCount < enemyAmount)
         {
             enemyFactory.GetNewInstance(gameObject.transform.position, gameObject.transform.rotation);
             _enemyCount++;
         }
     }
 }