You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

33 line
565 B

  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.UI;
  4. public class OverlayButton : MonoBehaviour
  5. {
  6. public void EnableButton(Action onClick)
  7. {
  8. base.gameObject.SetActive(true);
  9. this._onClick = onClick;
  10. this._buttonComponent.enabled = true;
  11. }
  12. public void DisableButton()
  13. {
  14. this._buttonComponent.enabled = false;
  15. base.gameObject.SetActive(false);
  16. }
  17. public void OnClick()
  18. {
  19. if (this._onClick != null)
  20. {
  21. this._onClick();
  22. }
  23. }
  24. [SerializeField]
  25. private Button _buttonComponent;
  26. private Action _onClick;
  27. }