PlayAreaOKUI.cs 982 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.UI;
  4. public class PlayAreaOKUI : MonoBehaviour
  5. {
  6. public Action OnRedrawAreaClick
  7. {
  8. get;
  9. set;
  10. }
  11. public Action OnContinueClick
  12. {
  13. get;
  14. set;
  15. }
  16. public Action OnBackClick
  17. {
  18. get;
  19. set;
  20. }
  21. public Button redrawAreaButton;
  22. public Button continueButton;
  23. public Button backButton;
  24. public void Init()
  25. {
  26. redrawAreaButton.onClick.AddListener(() =>
  27. {
  28. OnRedrawAreaClick?.Invoke();
  29. });
  30. continueButton.onClick.AddListener(() =>
  31. {
  32. OnContinueClick?.Invoke();
  33. });
  34. backButton.onClick.AddListener(() =>
  35. {
  36. OnBackClick?.Invoke();
  37. });
  38. }
  39. public void Release()
  40. {
  41. redrawAreaButton.onClick.RemoveAllListeners();
  42. continueButton.onClick.RemoveAllListeners();
  43. backButton.onClick.RemoveAllListeners();
  44. }
  45. }