示例#1
0
 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);
 }
示例#2
0
 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);
 }
示例#3
0
        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);
        }
示例#4
0
        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);
        }