Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        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();
            }
        }