FBButton.cs 780 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System;
  2. using UnityEngine;
  3. namespace FBInput
  4. {
  5. [ExecuteInEditMode]
  6. [RequireComponent(typeof(UIButton))]
  7. public class FBButton : BaseBehaviour
  8. {
  9. public bool IsPressed
  10. {
  11. get
  12. {
  13. return this._uiButton.state == UIButtonColor.State.Pressed;
  14. }
  15. }
  16. public bool IsActive
  17. {
  18. get
  19. {
  20. return base.gameObject.activeSelf;
  21. }
  22. set
  23. {
  24. base.gameObject.SetActive(value);
  25. }
  26. }
  27. public string Text
  28. {
  29. get
  30. {
  31. return (!(this._uiLabel != null)) ? string.Empty : this._uiLabel.text;
  32. }
  33. set
  34. {
  35. if (this._uiLabel != null)
  36. {
  37. this._uiLabel.text = value;
  38. }
  39. }
  40. }
  41. [SerializeField]
  42. private UIButton _uiButton;
  43. [SerializeField]
  44. private UILabel _uiLabel;
  45. }
  46. }