private async void LoadWindowAsync(Action loadedHandle = null) { IResourcesManager tmpResMgr = GameModuleManager.GetModule <IResourcesManager>(); await tmpResMgr.LoadBundleByTypeAsync(EABType.UI, BundleName); if (null != loadedHandle) { loadedHandle(); loadedHandle = null; } if (mIsDestroyed || mIsInited) { tmpResMgr.UnLoadBundleByType(EABType.UI, BundleName); return; } GameObject tmpGo = Hotfix.Instantiate(tmpResMgr.GetAssetByType <GameObject>(EABType.UI, BundleName)); InitWindow(tmpGo); if (mIsShowAfterLoaded) { Show(); } }
private void LoadWindowSync(Action loadedHandle = null) { IResourcesManager tmpResMgr = GameModuleManager.GetModule <IResourcesManager>(); tmpResMgr.LoadBundleByType(EABType.UI, BundleName); GameObject tmpGo = Hotfix.Instantiate(tmpResMgr.GetAssetByType <GameObject>(EABType.UI, BundleName)); InitWindow(tmpGo); loadedHandle?.Invoke(); }
internal async Task LoadWindowAsync() { IResourcesManager tmpResMgr = GameModuleManager.GetModule <IResourcesManager>(); await tmpResMgr.LoadBundleByTypeAsync(EABType.UI, BundleName); if (mIsDestroyed) { tmpResMgr.UnLoadBundleByType(EABType.UI, BundleName); return; } InitWindow(tmpResMgr.GetAssetByType <GameObject>(EABType.UI, BundleName)); if (mIsShowAfterLoaded) { Show(); } }