/// <summary> /// 播放神兽声音 /// </summary> /// <param name="strAudioFile"></param> public void PlayVoice(string strAudioFile) { if (this.m_CurrentVoice != null && !this.m_CurrentVoice.IsStopped) { this.m_CurrentVoice.Stop(); this.m_CurrentVoice = null; } float volumeBeastVoice = Singleton <AudioManager> .singleton.VolumeBeastVoice; this.m_CurrentVoice = Singleton <AudioManager> .singleton.PlayAudioOneShot(strAudioFile, volumeBeastVoice, null); }
public AudioOneShotPlay PlayAudioOneShot(string strAudioFile, float fVolume, Action <AudioOneShotPlay> callBack) { AudioOneShotPlay ins = CInstacePoolKeepNumber <AudioOneShotPlay> .Alloc(); ins.m_hostObject = this.m_gameObjectCached; ins.m_audioFile = strAudioFile; ins.m_audioVolume = fVolume; ins.m_callBack = callBack; ins.IsStopped = false; WWWResourceManager.Instance.Load(strAudioFile, ins.OnLoadOneShotAudioFinished); return(ins); }