ConfirmPlayAreaUI.cs 694 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.UI;
  4. public class ConfirmPlayAreaUI : MonoBehaviour
  5. {
  6. public Action OnConfirmClick
  7. {
  8. get;
  9. set;
  10. }
  11. public Action OnBackClick
  12. {
  13. get;
  14. set;
  15. }
  16. public Button confirmClick;
  17. public Button backClick;
  18. public void Init()
  19. {
  20. confirmClick.onClick.AddListener(() =>
  21. {
  22. OnConfirmClick?.Invoke();
  23. });
  24. backClick.onClick.AddListener(()=>
  25. {
  26. OnBackClick?.Invoke();
  27. });
  28. }
  29. public void Release()
  30. {
  31. confirmClick.onClick.RemoveAllListeners();
  32. backClick.onClick.RemoveAllListeners();
  33. }
  34. }