void Enter(UIState state) { if (mCurWndOptioner != null) { Debug.LogWarning("������������Enter?"); Destroy(mCurWndOptioner.gameObject); mCurWndOptioner = null; } gameObject.SetActiveRecursively(true); mUIState = state; switch (state) { case UIState.Admin: { mCurWndOptioner = Instantiate(Prefab_WndOptionMoverAdmin, transform.position, Quaternion.identity) as Wnd_OptionMoveAble; Transform ts = mCurWndOptioner.transform.Find("option4/ctrl_��ǰ��ʾ״̬"); Ctrl_OptionText ctrlOption = null; if (ts != null) { ctrlOption = ts.GetComponent <Ctrl_OptionText>(); } if (ctrlOption != null) { ctrlOption.ViewIdx = GameMain.Singleton.BSSetting.Dat_GameShowLanguageSetup.Val ? 0 : 1; ctrlOption.UpdateText(); } } break; case UIState.Arena: mCurWndOptioner = Instantiate(Prefab_WndOptionMoverArena, transform.position, Quaternion.identity) as Wnd_OptionMoveAble; break; } mCurWndOptioner.transform.parent = transform; mCurWndOptioner.transform.localPosition = Vector3.zero; mCurWndOptioner.EvtSelectChanged += Handle_OptionSelectorChanged; mCurWndOptioner.EvtConfirm += Handle_OptionSelectorConfirm; GameMain.EvtInputKey += Handle_Input; UpdateView(); }
void Exit() { if (GameMain.IsEditorShutdown) { return; } gameObject.SetActiveRecursively(false); if (mCurWndOptioner != null) { Destroy(mCurWndOptioner.gameObject); mCurWndOptioner = null; } if (mCurWndOptioner != null) { Destroy(mCurWndOptioner.gameObject); mCurWndOptioner = null; } GameMain.EvtInputKey -= Handle_Input; }
void Exit() { if (GameMain.IsEditorShutdown) return; gameObject.SetActiveRecursively(false); if (mCurWndOptioner != null) { Destroy(mCurWndOptioner.gameObject); mCurWndOptioner = null; } if (mCurWndOptioner != null) { Destroy(mCurWndOptioner.gameObject); mCurWndOptioner = null; } GameMain.EvtInputKey -= Handle_Input; }
void Enter(UIState state) { if (mCurWndOptioner != null) { Debug.LogWarning("������������Enter?"); Destroy(mCurWndOptioner.gameObject); mCurWndOptioner = null; } gameObject.SetActiveRecursively(true); mUIState = state; switch (state) { case UIState.Admin: { mCurWndOptioner = Instantiate(Prefab_WndOptionMoverAdmin, transform.position, Quaternion.identity) as Wnd_OptionMoveAble; Transform ts = mCurWndOptioner.transform.FindChild("option4/ctrl_��ǰ��ʾ״̬"); Ctrl_OptionText ctrlOption = null; if(ts!=null) ctrlOption = ts.GetComponent<Ctrl_OptionText>(); if (ctrlOption != null) { ctrlOption.ViewIdx = GameMain.Singleton.BSSetting.Dat_GameShowLanguageSetup.Val ? 0 : 1; ctrlOption.UpdateText(); } } break; case UIState.Arena: mCurWndOptioner = Instantiate(Prefab_WndOptionMoverArena, transform.position, Quaternion.identity) as Wnd_OptionMoveAble; break; } mCurWndOptioner.transform.parent = transform; mCurWndOptioner.transform.localPosition = Vector3.zero; mCurWndOptioner.EvtSelectChanged += Handle_OptionSelectorChanged; mCurWndOptioner.EvtConfirm += Handle_OptionSelectorConfirm; GameMain.EvtInputKey += Handle_Input; UpdateView(); }