private void Spawn() { AsteroidHelper.Stages stage = (AsteroidHelper.Stages)Random.Range(0, Enum.GetNames(typeof(AsteroidHelper.Stages)).Length); int type = Random.Range(0, AsteroidHelper.AsteroidTypesCount); GameObject asteroid = Instantiate(ResourcesLoader.GetAsteroid(stage, type), GetRandomSpawnPosition(), Quaternion.identity); if (GameState.IsActive()) { Invoke(nameof(Spawn), _spawnInterval); } }