public int PlayBg(string name, bool loop = true, Action <int> callBack = null, int customEventID = -1) { m_MainUnit.SetAudio(gameObject, name, loop, m_IsMusicEnable); m_MainUnit.SetOnFinishListener(callBack); m_MainUnit.customEventID = customEventID; return(m_MainUnit.id); }
public AudioUnit PlayBg(string name, bool loop = true, Action <AudioUnit> callBack = null, int customEventID = -1) { m_MainUnit.SetAudio(gameObject, name, loop); m_MainUnit.SetOnFinishListener(callBack); m_MainUnit.customEventID = customEventID; return(m_MainUnit); }
public int PlaySound(string name, bool loop = false, Action <int> callBack = null, int customEventID = -1) { if (string.IsNullOrEmpty(name)) { return(-1); } AudioUnit unit = AudioUnit.Allocate(); unit.SetAudio(gameObject, name, loop, m_IsSoundEnable); unit.SetOnFinishListener(callBack); unit.customEventID = customEventID; return(unit.id); }
public AudioUnit PlaySound(string name, bool loop = false, Action <AudioUnit> callBack = null, int customEventID = -1) { if (string.IsNullOrEmpty(name)) { return(null); } AudioUnit unit = ObjectPool <AudioUnit> .S.Allocate(); unit.SetAudio(gameObject, name, loop); unit.SetOnFinishListener(callBack); unit.customEventID = customEventID; return(unit); }