private void _Close(int _uiType) { if (_uiType == -1) { foreach (int uiType in _openedUIs.Keys) { _waitCloseUIs.Add(_uiType); } } SubUI subUi = null; if (_openedUIs.TryGetValue(_uiType, out subUi)) { _openedUIs.Remove(_uiType); if (!subUi.OnHide()) { subUi.CachedGameObject.SetActive(false); } } else { _openedUIs.Remove(_uiType); UnityEngine.Object.Destroy(subUi.gameObject); } }
public void AddSubUI(int index, SubUI subUi) { _SubUis[index] = subUi; }