ButtonData.cs 587 B

1234567891011121314151617181920
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using TMPro;
  6. namespace KairoEngine.UI.InteractionHandler
  7. {
  8. public class ButtonData : MonoBehaviour
  9. {
  10. public TextMeshProUGUI headerComponent;
  11. public Image graphicComponent;
  12. public void Setup(string text, Sprite graphic = null)
  13. {
  14. if(headerComponent != null && !string.IsNullOrEmpty(text)) headerComponent.text = text;
  15. if(graphic != null && graphicComponent != null) graphicComponent.sprite = graphic;
  16. }
  17. }
  18. }