SlotUImgr.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using System;
  2. using UnityEngine;
  3. public class SlotUImgr : MonoBehaviour
  4. {
  5. public static SlotUImgr Instance { get; private set; }
  6. public bool uiActive
  7. {
  8. get
  9. {
  10. return this.m_SlotGameUI.interactable && !GameMain.Instance.SysDlg.isActiveAndEnabled;
  11. }
  12. }
  13. private void Awake()
  14. {
  15. SlotUImgr.Instance = this;
  16. }
  17. private void Start()
  18. {
  19. ExChangeUI instance = ExChangeUI.Instance;
  20. instance.FadeInStartAction = (Action)Delegate.Combine(instance.FadeInStartAction, new Action(delegate
  21. {
  22. this.m_ButtonGroup.interactable = false;
  23. }));
  24. ExChangeUI instance2 = ExChangeUI.Instance;
  25. instance2.FadeOutEndAction = (Action)Delegate.Combine(instance2.FadeOutEndAction, new Action(this.UpdateUI));
  26. this.UpdateUI();
  27. }
  28. public void SetUIActive(bool set)
  29. {
  30. this.m_SlotGameUI.interactable = set;
  31. }
  32. public void UpdateUI()
  33. {
  34. int state = SceneCasinoSlot.Instance.sManager.state;
  35. this.m_SlotStopUI.interactable = (state >= 6 && state < 10);
  36. this.m_ButtonGroup.interactable = (state == 0 || state == 1);
  37. ExChangeUI.Instance.TextUIUpdate();
  38. ExChangeUI.Instance.SetButtonState(false);
  39. if (this.m_ButtonGroup.interactable)
  40. {
  41. ExChangeUI.Instance.UIStateUpdate();
  42. ExChangeUI.Instance.SetButtonState(true);
  43. }
  44. }
  45. public void PushEnd()
  46. {
  47. GameMain.Instance.SysDlg.Show("カジノ画面に戻ります", SystemDialog.TYPE.OK_CANCEL, new SystemDialog.OnClick(SceneCasinoSlot.Instance.SlotEnd), null);
  48. }
  49. [SerializeField]
  50. private CanvasGroup m_SlotGameUI;
  51. [SerializeField]
  52. private CanvasGroup m_SlotStopUI;
  53. [SerializeField]
  54. private CanvasGroup m_ButtonGroup;
  55. }