コード例 #1
0
ファイル: MusicManager.cs プロジェクト: hww/varp_sounds
        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);
        }
コード例 #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);
        }
コード例 #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);
        }