void Release_Internel(UIBasePanel panel) { if (panel == null) { return; } panel.Release(); UIAssetManager.UnloadTexturesOnGameObject(panel.CachedGameObject); if (_allPanels.ContainsKey(panel.name)) { _allPanels.Remove(panel.name); } UIAssetManager.UI_Destroy_GameObject(panel.CachedGameObject); }
public void ShowUI(string uiName, object args = null, Action <UIBasePanel> onUIReady = null) { if (string.IsNullOrEmpty(uiName)) { this.LogWarning("Null ui name!!!"); return; } if (!_allPanels.ContainsKey(uiName)) { UIAssetManager.RequestUIPopup(uiName, delegate(string popupName, GameObject uiPopup) { if (uiPopup == null) { Debug.LogError("Can't load the ui prefab: " + popupName); return; } UIBasePanel panel = uiPopup.GetComponent <UIBasePanel>(); AnchorUIGameObject(panel); panel.Setup(); _allPanels.Add(uiName, panel); // add to pool. Show_Internel(panel, args, onUIReady); if (UIReleaseCheckOnHide == false) { CheckToReleaseUI(); } }); } else { UIBasePanel panel = _allPanels[uiName]; Show_Internel(panel, args, onUIReady); } }