private void Start() { StandardBehaviorEnemy = new List <GameObject> { cube_enemy, cylinder_enemy, cone_enemy, sphere_enemy }; spawnInterval = ActiveLevelData.GetNewSpawnInterval(stepType); spawnPosY = ScreenBorders.Top + ScreenBorders.Top / 10; positionArray = SpawnPositionCalculator(); }
void Update() { timeCount += Time.deltaTime; if (timeCount > spawnInterval) { Enemy_Spawner(); ++EnemyCounter; timeCount = default; if (EnemyCounter >= ActiveLevelData.DifficultyIncreaseStep) { spawnInterval = ActiveLevelData.GetNewSpawnInterval(stepType, ActiveLevelData.SpawnIntervalStep); EnemyCounter = default; } else { spawnInterval = ActiveLevelData.GetNewSpawnInterval(stepType); } } }