Пример #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();
            }
        }
Пример #2
0
        public void Destroy()
        {
            mIsInited    = false;
            mIsDestroyed = true;

            if (mGameObejct)
            {
                GameObject.Destroy(mGameObejct);
                mGameObejct = null;
                IResourcesManager tmpResMgr = GameModuleManager.GetModule <IResourcesManager>();
                tmpResMgr.UnLoadBundleByType(EABType.UI, BundleName);
            }
        }
Пример #3
0
        public void ClearByType(EABType eABType)
        {
            GameObjectPool tmpGoPool = null;

            if (mABType2GoPoolDict.TryGetValue(eABType, out tmpGoPool))
            {
                tmpGoPool.Clear((name, count) =>
                {
                    for (int i = 0; i < count; ++i)
                    {
                        mResMgr.UnLoadBundleByType(eABType, name);
                    }
                });

                mABType2GoPoolDict.Remove(eABType);
            }
        }
Пример #4
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();
            }
        }