SettingView.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using UI.RoleInfo;
  2. using System.Text.RegularExpressions;
  3. namespace GFGGame
  4. {
  5. public class SettingView : BaseWindow
  6. {
  7. private UI_SettingUI _ui;
  8. public override void Dispose()
  9. {
  10. if (_ui != null)
  11. {
  12. _ui.Dispose();
  13. _ui = null;
  14. }
  15. base.Dispose();
  16. }
  17. protected override void OnInit()
  18. {
  19. base.OnInit();
  20. packageName = UI_SettingUI.PACKAGE_NAME;
  21. _ui = UI_SettingUI.Create();
  22. this.viewCom = _ui.target;
  23. this.viewCom.Center();
  24. this.modal = true;
  25. _ui.m_btnExit.onClick.Add(OnClickBtnExit);
  26. _ui.m_btnLogout.onClick.Add(OnClickBtnLogout);
  27. _ui.m_btnSound.onClick.Add(OnClickBtnSound);
  28. _ui.m_btnMusic.onClick.Add(OnClickBtnMusic);
  29. }
  30. protected override void OnShown()
  31. {
  32. base.OnShown();
  33. }
  34. protected override void OnHide()
  35. {
  36. base.OnHide();
  37. }
  38. private void OnClickBtnExit()
  39. {
  40. AlertSystem.Show("횅훰럿쀼되쩌女찐?")
  41. .SetLeftButton(true)
  42. .SetRightButton(true, "횅훰", (object data) =>
  43. {
  44. GameController.QuitToLoginView(false);
  45. });
  46. }
  47. private void OnClickBtnLogout()
  48. {
  49. AlertSystem.Show("횅훰鬧饋뎠품瑯뵀찐?")
  50. .SetLeftButton(true)
  51. .SetRightButton(true, "횅훰", (object data) =>
  52. {
  53. GameController.QuitToLoginView(true);
  54. });
  55. }
  56. private void OnClickBtnSound()
  57. {
  58. SoundManager.Instance.isOn = _ui.m_btnSound.selected;
  59. }
  60. private void OnClickBtnMusic()
  61. {
  62. MusicManager.Instance.isOn = _ui.m_btnMusic.selected;
  63. }
  64. }
  65. }