Пример #1
0
 /// <summary>
 /// 手动播放音效
 /// </summary>
 /// <param name="audio">指定音效</param>
 /// <param name="loop">是否循环播放</param>
 public void PlayManual(AudioSystem.AudioMenel audio, bool isStop, bool loop)
 {
     if (OnPlayManual != null)
     {
         OnPlayManual(audio, isStop, loop);
     }
 }
Пример #2
0
        /// <summary>
        /// 处理手动播放音效
        /// </summary>
        /// <param name="audio">指定音效</param>
        /// <param name="loop">是否循环播放</param>
        void OnPlayManual(AudioSystem.AudioMenel audio, bool isStop, bool loop)
        {
            if (debugEnable)
            {
                DEBUG.Graphics("AudioManage.OnPlayManual, " + audio + ", " + loop);
            }
            int audioIndex = (int)audio;

            if (isStop)
            {
                Debug.LogError("停止播放");
                ManualSources[audioIndex].Stop();
                return;
            }
            if (ManualSources[audioIndex] != null)
            {
                ManualSources[audioIndex].Stop();
                ManualSources[audioIndex].loop = loop;
                ManualSources[audioIndex].Play();
            }
        }