void ChangeScence() { SingletonMono <SceneManager> .GetInstance().LoadScene("Login", null, () => { Singleton <WindowManager> .GetInstance().OpenWindow("LoginAndRegister", true); }, null); }
void InitBaseSys() { SingletonMono <LuaManager> .GetInstance(); SingletonMono <AudioManager> .GetInstance(); Singleton <ConfigManager.ConfigManager> .GetInstance(); SingletonMono <MonoHelper> .GetInstance(); Singleton <TimeManager> .GetInstance(); Singleton <EventManager> .GetInstance(); Singleton <EventRouter> .GetInstance(); Singleton <WindowManager> .GetInstance(); SingletonMono <CoroutineExecutor> .GetInstance(); Singleton <ResourceManager> .GetInstance(); SingletonMono <ServerManager> .GetInstance(); Singleton <LanguageManager> .GetInstance(); }
/// <summary> /// 实际加载文件的函数 /// </summary> /// <param name="task"></param> private void DoImmediateTask(ResourceLoadTask task) { m_currentTaskCount += 1; if (task.LoadType == (int)AssetBundleLoadType.LoadBundleFromFile) { LoadBundleFromFile(task); } else if (task.LoadType == (int)AssetBundleLoadType.LoadBundleFromFileAsync) { SingletonMono <GameFrameWork> .GetInstance().StartCoroutine(LoadBundleFromFileAsync(task)); } else if (task.LoadType == (int)AssetBundleLoadType.LoadFromMemory) { LoadBundleFromMemory(task); } else if (task.LoadType == (int)AssetBundleLoadType.LoadFromMemoryAsync) { SingletonMono <GameFrameWork> .GetInstance().StartCoroutine(LoadBundleFromMemoryAsync(task)); } else if (task.LoadType == (int)AssetBundleLoadType.LoadFromStream) { LoadBundleFromStream(task); } else if (task.LoadType == (int)AssetBundleLoadType.LoadFromStreamAsync) { SingletonMono <GameFrameWork> .GetInstance().StartCoroutine(LoadBundleFromStreamAsync(task)); } else { m_currentTaskCount -= 1; Debuger.LogError("loadtype 出错"); } }
private void UpdateCallback(bool isok) { IsUpdateDone = isok; SingletonMono <LuaManager> .GetInstance().InitStart(); Singleton <ConfigManager.ConfigManager> .GetInstance().InitConfig(); ChangeScence(); }
/// <summary> /// 清理内存 /// </summary> public void CleanupMemoryInterval() { if (!(Time.realtimeSinceStartup > _cleanupMemoryLastTime + CleanUpMemoryDelayTime) || !_canStartCleanupMemory) { return; } _canStartCleanupMemory = false; SingletonMono <GameFrameWork> .GetInstance().StartCoroutine(CleanupMemoryAsync()); }
private IEnumerator CleanupMemoryAsync() { //清理内存 yield return(Resources.UnloadUnusedAssets()); //清理mono GC.Collect(); //清理lua SingletonMono <LuaManager> .GetInstance().LuaGC(); _canStartCleanupMemory = true; _cleanupMemoryLastTime = Time.realtimeSinceStartup; }
private void OnApplicationQuit() { Singleton <EventRouter> .GetInstance().OnDestory(); Singleton <EventManager> .GetInstance().OnDestory(); Singleton <TimeManager> .GetInstance().OnDestory(); SingletonMono <LuaManager> .GetInstance().Close(); SingletonMono <ServerManager> .GetInstance().OnDestory(); SingletonMono <AudioManager> .GetInstance().OnDestory(); }
void Update() { Singleton <TimeManager> .GetInstance().OnUpdate(); if (IsUpdateDone == false) { Singleton <UpdateManager> .GetInstance().OnUpdate(); } Singleton <WindowManager> .GetInstance().OnUpdate(); Singleton <ResourceManager> .GetInstance().OnUpdate(); SingletonMono <AudioManager> .GetInstance().OnUpdate(); SingletonMono <MonoHelper> .GetInstance().OnUpdate(); }
void FixedUpdate() { SingletonMono <MonoHelper> .GetInstance().OnFixedUpdate(); }
void LateUpdate() { Singleton <WindowManager> .GetInstance().OnLateUpdate(); SingletonMono <MonoHelper> .GetInstance().OnLaterUpdate(); }
public void LoadResourceAsync <T>(string name, Action <Object> callback) where T : Object { SingletonMono <GameFrameWork> .GetInstance().StartCoroutine(IELoadResourceAsync <T>(name, callback)); }