Esempio n. 1
0
 public void SetLoadLevel(BuildIndex levelInt)
 {
     if (levelInt == BuildIndex.RANDOM)
     {
         levelInt = SelectRandomLevel();
     }
     gameData.SetGameLevel(levelInt);
     loadLevelBuildIndex = levelInt;
     OpenConfirmationMenu();
 }
Esempio n. 2
0
        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
                           )
                       ));
        }
Esempio n. 3
0
    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);
        }
    }
Esempio n. 4
0
 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);
Esempio n. 6
0
 public static void LoadLevel(BuildIndex buildIndex)
 {
     SceneManager.LoadSceneAsync((int)buildIndex);
 }