public override void Destroyobj() { hasDestroy = true; if (BagUI.Instance != null) { if (BagUI.Instance.GetRole() != null) { BagUI.Instance.GetRole().SetActive(true); } } if (GamePlayer.Instance.babies_list_.Count != 0) { if (MainbabyUI.Instance != null) { if (MainbabyUI.Instance.isState) { if (MainbabyListUI.babyObj != null) { MainbabyListUI.babyObj.SetActive(true); } } } } UIAssetMgr.DeleteAsset(openedBabyBank, true); BankSystem.instance.isopen = false; // if (roleObj != null) // roleObj.SetActive (true); }
public void CloseUI(UIASSETS_ID assetID, bool unLoadAllLoadedObjects) { UIBase ba = null; if (mainPanelObj != null && mType == menuTypes.MAIN) { ba = mainPanelObj.GetComponent <UIBase> (); } else { //ba = popPanelObj.GetComponent<UIBase> (); } if (ba != null) { ba.Destroyobj(); //GlobalInstanceFunction.Instance.ReleaseTexture(ba.transform); } else { if (mainPanelObj != null && mType == menuTypes.MAIN) { //GlobalInstanceFunction.Instance.ReleaseTexture(mainPanelObj.transform); Destroy(mainPanelObj); } else { //ReleaseTexture(popPanelObj.transform); //Destroy(popPanelObj); } } UIAssetMgr.DeleteAsset(assetID, unLoadAllLoadedObjects); }
void UpdateRight() { UIASSETS_ID uiId = GlobalValue.GetMoreActivityID(crtType_); if (uiId != (UIASSETS_ID)0) { loadingSub_ = true; UIAssetMgr.LoadUI(uiId, (AssetBundle Asset, ParamData Param) => { if (rightContent_ == null) { UIAssetMgr.DeleteAsset(uiId, true); return; } GameObject subUi = (GameObject)GameObject.Instantiate(Asset.mainAsset) as GameObject; Asset.Unload(false); subUi.transform.parent = rightContent_; subUi.transform.localScale = Vector3.one; subUi.transform.localPosition = Vector3.zero; UIManager.Instance.AdjustUIDepth(subUi.transform, false); loadingSub_ = false; }, null); } }
public void DestroyLoadingUI() { if (destroyed) { return; } if (GameManager.Instance != null) { GameManager.Instance.SetChatUIActive(true); } if (StageMgr.Loadtype == SwitchScenEffect.LoadingBar) { //GlobalInstanceFunction.Instance.ReleaseTexture(transform); UIAssetMgr.DeleteAsset(UIASSETS_ID.UIASSETS_LoadingPanel, true); Destroy(gameObject); GameManager.Instance.EnableDelayCheck(true); HeadIconLoader.Instance.Delete(scenenicon); } }
private void LoadBabyUI(UIASSETS_ID id) { //subUiResPath = GlobalInstanceFunction.Instance.GetAssetsName((int)id, AssetLoader.EAssetType.ASSET_UI); UIAssetMgr.LoadUI(id, (Assets, paramData) => { if (hasDestroy) { //AssetInfoMgr.Instance.DecRefCount(subUiResPath, true); UIAssetMgr.DeleteAsset(id, true); return; } if (null == Assets || null == Assets.mainAsset) { UIAssetMgr.DeleteAsset(id, true); return; } GameObject go = (GameObject)GameObject.Instantiate(Assets.mainAsset) as GameObject; if (this == null && !gameObject.activeSelf) { Destroy(go); return; } babyObj = go; go.transform.parent = this.panel.transform; go.transform.localPosition = Vector3.zero; go.transform.localScale = Vector3.one; //UIManager.Instance.AdjustUIDepth(go.transform); if (babyBtn.isEnabled) { babyObj.gameObject.SetActive(false); return; } UIManager.Instance.AdjustUIDepth(transform); //AssetInfoMgr.Instance.DecRefCount(subUiResPath, false); openedBabyBank = id; } , null); }
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); }
private void LoadUI(UIASSETS_ID id, int num) { subUiResPath = GlobalInstanceFunction.Instance.GetAssetsName((int)id, AssetLoader.EAssetType.ASSET_UI); if (subUIs_ == null) { subUIs_ = new List <string>(); subUIs_.Add(subUiResPath); } else { if (!subUIs_.Contains(subUiResPath)) { subUIs_.Add(subUiResPath); } } UIAssetMgr.LoadUI(subUiResPath, (Assets, paramData) => { if (hasDestroy) { UIAssetMgr.DeleteAsset(subUiResPath); return; } if (null == Assets || null == Assets.mainAsset) { return; } GameObject go = (GameObject)GameObject.Instantiate(Assets.mainAsset) as GameObject; if (this == null && !gameObject.activeSelf) { Destroy(go); } go.transform.parent = back.transform; go.transform.localPosition = Vector3.zero; go.transform.localScale = Vector3.one; if (num == 1) { familyConstructionObj = go; if (Guildbtns[num].isEnabled) { familyConstructionObj.SetActive(false); } } else if (num == 2) { familyShopingObj = go; if (Guildbtns[num].isEnabled) { familyShopingObj.SetActive(false); } } else if (num == 3) { familyZhufuObj = go; if (Guildbtns[num].isEnabled) { familyZhufuObj.SetActive(false); } } else if (num == 4) { familyZhufuOHD = go; if (Guildbtns[num].isEnabled) { familyZhufuOHD.SetActive(false); } } if (num == 5) { familyMessageObj = go; if (Guildbtns[num].isEnabled) { familyMessageObj.SetActive(false); } } UIManager.Instance.AdjustUIDepth(go.transform); NetWaitUI.HideMe(); UIManager.Instance.AdjustUIDepth(go.transform); } , null); }