void OnDestroy() { instance = null; rootPanel = null; lobbyPanelPathArray = null; uiLobby = null; uiMessageBox = null; uiGameReady = null; uiHeroList = null; uiTowerList = null; uiWaiting = null; uiBaseInfo = null; uiGameOption = null; uiShop = null; }
private void LoadUICompleteCB(GameObject gameObj, System.Guid uid, params object[] param) { if (gameObj != null) { GameObject createObj = Instantiate(gameObj) as GameObject; createObj.transform.parent = rootPanel.transform; createObj.transform.localPosition = Vector3.zero; createObj.transform.localScale = gameObj.transform.localScale; switch ((eUIType)param[0]) { case eUIType.Type_Lobby: uiLobby = createObj.GetComponent <UILobby>(); break; case eUIType.Type_MessageBox: uiMessageBox = createObj.GetComponent <UIMessageBox>(); break; case eUIType.Type_GameReady: uiGameReady = createObj.GetComponent <UIGameReady>(); if (param.Length > 1 && (bool)param[1]) { uiGameReady.OpenFrame(); } break; case eUIType.Type_Hero: uiHeroList = createObj.GetComponent <UIHeroList>(); if (param.Length > 1 && (bool)param[1]) { uiHeroList.OpenFrame(); } break; case eUIType.Type_Tower: uiTowerList = createObj.GetComponent <UITowerList>(); if (param.Length > 1 && (bool)param[1]) { uiTowerList.OpenFrame(); } break; case eUIType.Type_Waiting: uiWaiting = createObj.GetComponent <UIWaiting>(); break; case eUIType.Type_Base: uiBaseInfo = createObj.GetComponent <UIBaseInfo>(); if (param.Length > 1 && (bool)param[1]) { uiBaseInfo.OpenFrame(); } break; case eUIType.Type_Option: uiGameOption = createObj.GetComponent <UIGameOption>(); if (param.Length > 1 && (bool)param[1]) { uiGameOption.OpenFrame(); } break; case eUIType.Type_Shop: uiShop = createObj.GetComponent <UIShop>(); if (param.Length > 1 && (bool)param[1]) { uiShop.OpenFrame(); } break; } } }