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
        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();
            }
        }