Button.cs 595 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using UnityEngine;
  3. namespace MeidoPhotoStudio.Plugin;
  4. public class Button : BaseControl
  5. {
  6. public Button(string label) =>
  7. Label = label;
  8. public string Label { get; set; }
  9. public override void Draw(params GUILayoutOption[] layoutOptions)
  10. {
  11. var buttonStyle = new GUIStyle(GUI.skin.button);
  12. Draw(buttonStyle, layoutOptions);
  13. }
  14. public void Draw(GUIStyle buttonStyle, params GUILayoutOption[] layoutOptions)
  15. {
  16. if (GUILayout.Button(Label, buttonStyle, layoutOptions))
  17. OnControlEvent(EventArgs.Empty);
  18. }
  19. }