void OnDestroy() { instance = null; rootArray = null; cameraArray = null; lobbyPanelPathArray = null; uiLobby = null; uiLobbyButton = null; uiMessageBox = null; uiHero = null; uiSkill = null; uiBullet = null; uiGoldShop = null; uiCashShop = null; uiLobbyButton = null; lobbyTabGroup = null; }
private void LoadUICompleteCB(GameObject gameObj, System.Guid uid, params object[] param) { if (gameObj != null) { GameObject createObj = Instantiate(gameObj) as GameObject; createObj.transform.parent = rootArray[(int)eRootType.Type_Back].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_Lobby_Button: uiLobbyButton = createObj.GetComponent <UILobbyButton>(); break; case eUIType.Type_MessageBox: uiMessageBox = createObj.GetComponent <UIMessageBox>(); break; case eUIType.Type_Waiting: uiWaiting = createObj.GetComponent <UIWaiting>(); break; case eUIType.Type_Hero: uiHero = createObj.GetComponent <UIHero>(); if (lobbyTabGroup != null) { lobbyTabGroup[(int)eUILobbyTab.Type_Hero] = uiHero; } break; case eUIType.Type_Skill: uiSkill = createObj.GetComponent <UISkill>(); if (lobbyTabGroup != null) { lobbyTabGroup[(int)eUILobbyTab.Type_Skill] = uiSkill; } break; case eUIType.Type_Weapon: uiBullet = createObj.GetComponent <UIBullet>(); if (lobbyTabGroup != null) { lobbyTabGroup[(int)eUILobbyTab.Type_Weapon] = uiBullet; } break; case eUIType.Type_Gold: uiGoldShop = createObj.GetComponent <UIGoldShop>(); if (lobbyTabGroup != null) { lobbyTabGroup[(int)eUILobbyTab.Type_Gold] = uiGoldShop; } break; case eUIType.Type_Gem: uiCashShop = createObj.GetComponent <UICashShop>(); if (lobbyTabGroup != null) { lobbyTabGroup[(int)eUILobbyTab.Type_Gem] = uiCashShop; } break; } } }
void Awake() { // Make this object the only instance instance = this; }