Esempio n. 1
0
        private void LoadAndStartGame(Map map, uint difficultyIndex)
        {
            this.map    = map;
            currentDiff = map.GetDifficulty(difficultyIndex);
            musicLoader = map.GetSong();

            musicLoaderEnumerator = musicLoader.GetAudioClip();

            doAction = DoActionLoadMusic;

            OnStart?.Invoke();
        }
Esempio n. 2
0
        private void DoActionLoadMusic()
        {
            if (musicLoaderEnumerator.MoveNext())
            {
                return;
            }

            musicPlayer.SetMusic(map.timing, musicLoader.clip);

            musicLoaderEnumerator = null;
            musicLoader           = null;

            //Permet d'attendre 1 frame avant le lancement de la musique
            doAction = DoActionStartGame;
        }
Esempio n. 3
0
        public static Map GetMap(string directoryPath)
        {
            Map lMap = new Map();

            try
            {
                string lJsonString = HandleTextFile.ReadString(directoryPath + "/" + MAIN_JSON);

                lMap = JsonUtility.FromJson <Map>(lJsonString);

                lMap.directoryPath = directoryPath;


                lMap.audioType = AudioClipGetter.GetAudioType(lMap.audio);
            }
            catch (Exception error)
            {
                lMap.LoadError = error;
            }

            return(lMap);
        }