UniversalViewer/Assets/KF3/Scripts/UI/UIKF3Container.cs

26 lines
560 B
C#
Raw Normal View History

using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
public class UIKF3Container : MonoBehaviour
{
public Button Button;
public RawImage RawImage;
public TextMeshProUGUI Label;
public UIKF3Container SetNames(string name, string label, Texture2D icon)
{
gameObject.name = name;
Label.text = label;
RawImage.texture = icon;
return this;
}
public UIKF3Container AddCallback(UnityAction action)
{
Button.onClick.AddListener(action);
return this;
}
}