Example #1
0
        public static SoundHandle PlayMusic()
        {
            StopMusic();
            autoPlayNext = true;
            musicHandle  = SoundSystem.Play(MusicListAudioEvent, onChangeState: OnMusicChangeState);
            var soundSource = SoundSystem.GetSource(musicHandle);

            Instance.PostMessage(Instance, ESustemMessage.MusicManagerChangeMusic, soundSource.EventName, soundSource.ClipName);
            return(musicHandle);
        }
Example #2
0
        public static bool IsExist(SoundHandle handle)
        {
            if (handle.Identifier == 0)
            {
                return(false);
            }
            var source = AllSources[handle.Identifier - 1];

            if (source.Handle == handle)
            {
                return(true);
            }
            return(false);
        }
Example #3
0
        public static SoundSource GetSource(SoundHandle handle)
        {
            if (handle.Identifier == 0)
            {
                return(null);
            }
            var source = AllSources[handle.Identifier - 1];

            if (source.Handle == handle)
            {
                return(source);
            }
            return(null);
        }