Пример #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();
        }
Пример #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;
        }
Пример #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);
        }