public void SetLoadLevel(BuildIndex levelInt) { if (levelInt == BuildIndex.RANDOM) { levelInt = SelectRandomLevel(); } gameData.SetGameLevel(levelInt); loadLevelBuildIndex = levelInt; OpenConfirmationMenu(); }
public static Task <string> CreateDocumentIndex <T>( this IMongoCollection <T> collection, BuildIndex <T> index, Action <CreateIndexOptions>?configure = null ) where T : Document { var options = new CreateIndexOptions(); configure?.Invoke(options); return(collection.Indexes.CreateOneAsync( new CreateIndexModel <T>( index(Builders <T> .IndexKeys), options ) )); }
void OnLevelWasLoaded() { int buildIndex = SceneManager.GetActiveScene().buildIndex; BuildIndex levelIndex = (BuildIndex)buildIndex; AudioClip newSong = soundStorage.GetSceneMusic(levelIndex); if (instance.musicSource.isPlaying && currentSong == null) { currentSong = newSong; } else if (currentSong != newSong && newSong != null) { currentSong = newSong; instance.musicSource.clip = newSong; instance.musicSource.loop = true; instance.musicSource.Play(); IEnumerator fadeInCoroutine = FadeIn(0f, 3f); StartCoroutine(fadeInCoroutine); } }
public void SetGameLevel(BuildIndex level) { gameLevel = level; }
public static Task <string> CreateDocumentIndex <T>( this IMongoDatabase database, BuildIndex <T> index, Action <CreateIndexOptions>?configure = null ) where T : Document => database.GetDocumentCollection <T>().CreateDocumentIndex(index, configure);
public static void LoadLevel(BuildIndex buildIndex) { SceneManager.LoadSceneAsync((int)buildIndex); }