123456789101112131415161718192021222324252627282930313233343536373839 |
- using System;
- using UnityEngine;
- public class AudioSourceParent : MonoBehaviour
- {
- private AudioSourceMgr AudioMan
- {
- get
- {
- return this.m_AudioMan;
- }
- }
- public void AttachVoice(Transform f_trParent, AudioSourceParent.dgOnDettach f_dgDetattchCallBack)
- {
- this.m_dgOnDetattch = f_dgDetattchCallBack;
- this.m_AudioMan = GameMain.Instance.SoundMgr.AllocVoice(f_trParent, true);
- }
- public void OnDestroy()
- {
- if (this.m_dgOnDetattch != null)
- {
- this.m_dgOnDetattch(this);
- this.m_dgOnDetattch = null;
- }
- if (this.m_AudioMan != null)
- {
- GameMain.Instance.SoundMgr.FreeVoice(this.m_AudioMan, false);
- this.m_AudioMan = null;
- }
- }
- public AudioSourceMgr m_AudioMan;
- private AudioSourceParent.dgOnDettach m_dgOnDetattch;
- public delegate void dgOnDettach(AudioSourceParent f_asp);
- }
|