public override void OnAppStart(ManagerSettingBase managerSetting) { m_name = typeof(SoundManager).ToString(); if (string.IsNullOrEmpty(m_name)) { throw new System.Exception("manager name is empty"); } m_setting = managerSetting as ManagerSettingBase; if (null == m_setting) { throw new System.Exception("manager setting is null"); } CreateRootObject(m_setting.transform, "SoundManager"); al = ComponentFactory.AddComponent <AudioListener>(RootObject); audioClips = new Dictionary <string, AudioClip>(); foreach (var name in m_stOnce) { var clip = Global.ResourceMgr.CreateSoundResource("Sound/SFX/" + name); audioClips.Add(name, clip.AudioClip); } musicPlayer = ComponentFactory.AddComponent <AudioSource>(RootObject); aliveSounds = new Dictionary <string, Audio>(); }
internal static void Begin( string url, IDictionary <string, string> queryParams, Action <string> callback = null) { ComponentFactory.AddComponent <AsyncRequest>() .SetUrl(url) .SetQueryParams(queryParams) .SetCallback(callback); }