void OpenMainUI(object obj) { m_curUIType = (LoginUIType)obj; CloseAllPanel(); IUIPanel uiPanel = null; if (UIList.TryGetValue(m_curUIType, out uiPanel)) { uiPanel.Show(); m_curUIPanel = uiPanel.gameObject; } else { uiPanel = GetPanel(m_curUIType); m_curUIPanel = uiPanel.gameObject; uiPanel.Show(); UIList.Add(m_curUIType, uiPanel); } if (m_curUIType == LoginUIType.CreatRole) { SetCamera(); } if (m_curUIType == LoginUIType.CreatRole || m_curUIType == LoginUIType.SelectRole) { //SoundManager.Instance.StopBGM(0.0f); //SoundManager.Instance.PlayBGM("Music_UIBG_LoginCharacter", 0.0f); } }
IUIPanel GetPanel(LoginUIType loginUIType) { GameObject CreatPanelPrefab = null; switch (loginUIType) { case LoginUIType.Login: CreatPanelPrefab = LoginUIPrefab; CheatManager.Instance.isIDKickedMark = false; CheatManager.Instance.isLogined = false; return(CreatObjectToNGUI.InstantiateObj(CreatPanelPrefab, transform).GetComponent <LoginUIPanel>() as IUIPanel); break; case LoginUIType.JoinGame: CreatPanelPrefab = JoinUIPrefab; break; case LoginUIType.ServerList: CreatPanelPrefab = ServerListUIPrefab; break; case LoginUIType.CreatRole: PlatformLoginBehaviour.message += " LoginUIManagerFor91 Handler CreateRole :"; CreatPanelPrefab = CreatRoleUIPreafab; CheatManager.Instance.isLogined = true; break; case LoginUIType.SelectRole: CreatPanelPrefab = RoleSelectUIPrefab; CheatManager.Instance.isLogined = true; break; case LoginUIType.Loaing: CreatPanelPrefab = LoadingSceneUIPreafab; break; default: TraceUtil.Log(SystemModel.Common, TraceLevel.Error, "SHowUI:" + loginUIType); break; } return(CreatObjectToNGUI.InstantiateObj(CreatPanelPrefab, transform).GetComponent <IUIPanel>()); }
IUIPanel GetPanel(LoginUIType loginUIType) { GameObject CreatPanelPrefab = null; switch (loginUIType) { case LoginUIType.Login: CreatPanelPrefab = LoginUIPanel; return(CreatObjectToNGUI.InstantiateObj(CreatPanelPrefab, transform).GetComponent <PlatformLoginPanel>() as IUIPanel); break; case LoginUIType.ServerList: CreatPanelPrefab = ServerListPanel; break; case LoginUIType.CreatRole: CreatPanelPrefab = CreatRoleUIPreafab; break; case LoginUIType.SelectRole: CreatPanelPrefab = RoleSelectUIPrefab; break; case LoginUIType.Loaing: CreatPanelPrefab = LoadingSceneUIPanel; break; case LoginUIType.LoginPlatformFail: CreatPanelPrefab = LoginFailPanelPrefab; break; default: TraceUtil.Log(SystemModel.Common, TraceLevel.Error, "SHowUI:" + loginUIType); break; } return(CreatObjectToNGUI.InstantiateObj(CreatPanelPrefab, transform).GetComponent <IUIPanel>()); }