PlayAreaWaitingDrawUI.cs 778 B

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