////////////////////////////////////方法实现////////////////////////////////////////// private void Awake() { #if !UNITY_EDITOR try { #endif for (var i = 0; i < mSFXChannelsCount; ++i) { mSFXChannel[i] = new MyAudioSource(); mSFXChannel[i].m_uID = -1; mSFXChannel[i].m_AudioSource = gameObject.AddComponent <AudioSource>(); } mBGAudioSource.m_AudioSource = gameObject.AddComponent <AudioSource>(); mBGAudioSource.m_uID = -1; mSoundClipPools = new SoundClipPools(); #if !UNITY_EDITOR } catch (Exception ex) { Logger.Error(ex.ToString()); } #endif }
////////////////////////////////////·½·¨ÊµÏÖ////////////////////////////////////////// void Awake() { DontDestroyOnLoad(this.gameObject); for (int i = 0; i < m_SFXChannelsCount; ++i) { m_SFXChannel[i] = new MyAudioSource(); m_SFXChannel[i].m_uID = -1; m_SFXChannel[i].m_AudioSource = gameObject.AddComponent <AudioSource>() as AudioSource; } m_BGAudioSource.m_AudioSource = gameObject.AddComponent <AudioSource>() as AudioSource; m_BGAudioSource.m_uID = -1; m_SoundClipPools = new SoundClipPools(); }
static int set_mSoundClipPools(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); SoundManager obj = (SoundManager)o; SoundClipPools arg0 = (SoundClipPools)ToLua.CheckObject(L, 2, typeof(SoundClipPools)); obj.mSoundClipPools = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index mSoundClipPools on a nil value" : e.Message)); } }
static int get_mSoundClipPools(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); SoundManager obj = (SoundManager)o; SoundClipPools ret = obj.mSoundClipPools; ToLua.PushObject(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index mSoundClipPools on a nil value" : e.Message)); } }