public void OnGet() { if (!m_isInPool) { Debuger.LogError("不在在对象池中");//检错下 } m_isInPool = false; #if !ART_DEBUG if (m_soundCfg != null) { //检错下 if (m_soundStopIfEnd != null) { Debuger.LogError("逻辑错误,特效绑定的音效没有清空:{0}", gameObject.name); SoundMgr.instance.Stop(m_soundStopIfEnd); m_soundStopIfEnd = null; } SoundFx3D sfx = SoundMgr.instance.Play3DSound(m_soundCfg.soundId, this.transform); if (sfx != null && m_soundCfg.stopIfEnd) { m_soundStopIfEnd = sfx; } } #endif }
public void OnPut() { if (m_isInPool) { Debuger.LogError("已经在对象池中");//检错下 } m_isInPool = true; //停止对应的音效 #if !ART_DEBUG if (m_soundStopIfEnd != null) { SoundFx3D sfx = m_soundStopIfEnd; m_soundStopIfEnd = null; SoundMgr.instance.Stop(sfx); } #endif }