public MusicMgr() { MonoMgr.GetInstance().AddUpdateListener(Updata); }
/// <summary> /// 切换场景 同步 /// </summary> /// <param name="name"></param> /// <param name="fun"></param> //public void LoadScene(string name, UnityAction fun, LoadSceneMode mode = LoadSceneMode.Additive) //{ // //场景同步加载 // SceneManager.LoadScene(name, mode); // //加载完成后 才回去执行fun // fun(); //} /// <summary> /// 提供给外部的 异步加载的接口方法 /// </summary> /// <param name="name"></param> /// <param name="fun"></param> public void LoadSceneAsyn(string name, UnityAction fun, LoadSceneMode mode = LoadSceneMode.Additive) { MonoMgr.GetInstance().StartCoroutine(ReallyLoadSceneAsync(name, fun, mode)); }
//异步加载资源 public void LoadAsync <T>(string name, UnityAction <T> callback) where T : Object { //开启异步加载的协程 MonoMgr.GetInstance().StartCoroutine(ReallyLoadAsync(name, callback)); }