public void Show(IYesNoDialogOwner owner, DialogWindowType type, string label = "label", string description = "description", bool change_effect = true) { this.m_DialogType = type; this.m_DW.m_LabelText.text = label; this.m_DW.m_DescriptionText.text = description; if (type == DialogWindowType.YesNo) { this.m_DW.m_Button1.gameObject.SetActive(true); this.m_DW.m_Button2.gameObject.SetActive(true); this.m_DW.m_Button3.gameObject.SetActive(false); } if (type == DialogWindowType.Ok) { this.m_DW.m_Button1.gameObject.SetActive(false); this.m_DW.m_Button2.gameObject.SetActive(false); this.m_DW.m_Button3.gameObject.SetActive(true); } base.gameObject.SetActive(true); this.m_Screen = owner; this.m_MainCanvasObject = GameObject.Find("MainMenuCanvas"); if (this.m_MainCanvasObject != null) { this.m_MainCanvas = this.m_MainCanvasObject.GetComponent <Canvas>(); this.m_MainCanvas.enabled = false; } this.m_ChangeEffect = change_effect; if (this.m_ChangeEffect) { PostProcessManager.Get().SetWeight(PostProcessManager.Effect.InGameMenu, 1f); } if (this.m_Screen is MainMenuScreen) { Time.timeScale = 0.5f; } }
private void Close() { base.gameObject.SetActive(false); this.SetCanvasActive(true); UIAudioPlayer.Play(UIAudioPlayer.UISoundType.Click); if (this.m_ChangeEffect) { PostProcessManager.Get().SetWeight(PostProcessManager.Effect.InGameMenu, 0f); } MenuScreen menuScreen = this.m_Screen as MenuScreen; if (menuScreen != null && !menuScreen.m_IsIngame) { Time.timeScale = 1f; } EventSystem current = EventSystem.current; if (current != null) { current.SetSelectedGameObject(null); } InputsManager.Get().UnregisterReceiver(this); IYesNoDialogOwner screen = this.m_Screen; if (screen == null) { return; } screen.OnCloseDialog(); }
public void Show(IYesNoDialogOwner owner, DialogWindowType type, string label = "label", string description = "description", bool change_effect = true) { this.m_DialogType = type; this.m_DW.m_LabelText.text = label; this.m_DW.m_DescriptionText.text = description; if (GreenHellGame.IsPadControllerActive()) { this.m_DW.m_Button1.gameObject.SetActive(false); this.m_DW.m_Button2.gameObject.SetActive(false); this.m_DW.m_Button3.gameObject.SetActive(false); if (type == DialogWindowType.YesNo) { this.m_DW.m_PadButton1.gameObject.SetActive(true); this.m_DW.m_PadButton2.gameObject.SetActive(true); this.m_DW.m_PadButton3.gameObject.SetActive(false); } else if (type == DialogWindowType.Ok) { this.m_DW.m_PadButton1.gameObject.SetActive(false); this.m_DW.m_PadButton2.gameObject.SetActive(false); this.m_DW.m_PadButton3.gameObject.SetActive(true); } } else { this.m_DW.m_PadButton1.gameObject.SetActive(false); this.m_DW.m_PadButton2.gameObject.SetActive(false); this.m_DW.m_PadButton3.gameObject.SetActive(false); if (type == DialogWindowType.YesNo) { this.m_DW.m_Button1.gameObject.SetActive(true); this.m_DW.m_Button2.gameObject.SetActive(true); this.m_DW.m_Button3.gameObject.SetActive(false); } else if (type == DialogWindowType.Ok) { this.m_DW.m_Button1.gameObject.SetActive(false); this.m_DW.m_Button2.gameObject.SetActive(false); this.m_DW.m_Button3.gameObject.SetActive(true); } } base.gameObject.SetActive(true); this.m_Screen = owner; this.SetCanvasActive(false); this.m_ChangeEffect = change_effect; if (this.m_ChangeEffect) { PostProcessManager.Get().SetWeight(PostProcessManager.Effect.InGameMenu, 1f); } MenuScreen menuScreen = this.m_Screen as MenuScreen; if (menuScreen != null && !menuScreen.m_IsIngame) { Time.timeScale = 0.5f; } InputsManager.Get().RegisterReceiver(this); }
public void OkButtonClicked() { UIAudioPlayer.Play(UIAudioPlayer.UISoundType.Click); IYesNoDialogOwner screen = this.m_Screen; if (screen != null) { screen.OnOkFromDialog(); } this.Close(); }