static public void DeleteAsset(UIASSETS_ID ID, bool unLoadAllLoadedObjects) { string AssetsName = GlobalInstanceFunction.Instance.GetAssetsName((int)ID, AssetLoader.EAssetType.ASSET_UI); DeleteAsset(AssetsName); string[] refAtlas = UIDepedenceData.GetRefAtlas(AssetsName); if (refAtlas == null) { ClientLog.Instance.Log(AssetsName + " UI has no refAtlas! AssetID is : " + ID); } AtlasLoader.Instance.DeleteAtlas(refAtlas); //AssetInfoMgr.Instance.DecRefCount( AssetsName, unLoadAllLoadedObjects ); }
public void Hide() { // Remove from global container. if (_PanelShowStates.ContainsKey(_UIResPath)) { //if(_PanelShowStates[_UIResPath] == UIShowCmd.Hide) //{ // return; //} _PanelShowStates[_UIResPath] = UIShowCmd.Hide; _PanelShown.Remove(_UIResPath); } if (_Panel == null) { return; } // 从场景移除. DoHide(); AtlasLoader.Instance.DeleteAtlas(UIDepedenceData.GetRefAtlas(_UIResPath)); UIAssetMgr.DeleteAsset(_UIResPath); }
public static bool LoadUI(string assetsName, AssetLoader.AssetLoadCallback CallBack, ParamData paramData) { LoadInfo info = new LoadInfo(); info.name_ = assetsName; info.callback_ = CallBack; info.pdata_ = paramData; string[] refAtlas = UIDepedenceData.GetRefAtlas(assetsName); if (refAtlas == null) { //因为MessageBoxPanel界面打开时,处于混沌伊始状态(无数据,无网络) 所以在此写死其所需的图集 囧 if (assetsName.Equals("MessageBoxPanel") || assetsName.Equals("ItemCell") || assetsName.Equals("BabyCell") || assetsName.Equals("StateCell") || assetsName.Equals("SkillCell")) { refAtlas = new string[] { "CommomAtlas" } } ; if (assetsName.Equals("Notice")) { refAtlas = new string[] { "noticeAtlas" } } ; if (assetsName.Equals("LoginPanel")) { refAtlas = new string[] { "NewLoginAtlas", "CommomAtlas" } } ; } if (refAtlas != null) { info.status_ = new Dictionary <string, AtlasLoader.AtlasStatus>(); AtlasLoader.AtlasStatus[] refStatus = AtlasLoader.Instance.LoadAtlas(refAtlas); for (int i = 0; i < refAtlas.Length; ++i) { info.status_.Add(refAtlas[i], refStatus[i]); } if (!LoadCheck(info)) { loadLst.Add(info); } } else { if (uiRefDic_.ContainsKey(assetsName)) { if (uiRefDic_[assetsName].hasBundle) { CallBack(uiRefDic_[assetsName].Open(), paramData); } else { uiRefDic_[assetsName].Open(CallBack); AssetLoader.LoadAssetBundle(assetsName, AssetLoader.EAssetType.ASSET_UI, LoadUICallback, paramData); } } else { UIBundleRef bundleRef = new UIBundleRef(); bundleRef.Open(CallBack); uiRefDic_.Add(assetsName, bundleRef); uiRef4For_.Add(bundleRef); AssetLoader.LoadAssetBundle(assetsName, AssetLoader.EAssetType.ASSET_UI, LoadUICallback, paramData); } } return(true); }