shaoxiadiablo/Assets/AGame/Scripts/UI/Common/AttributeWidget.cs
2025-05-18 01:04:31 +08:00

42 lines
915 B
C#

// ***********************************************************************
// Assembly : Game
// Author : Kimch
// Created : 2020-09-14
// Description :
// Last Modified By :
// Last Modified On :
// ***********************************************************************
// <copyright file= "AttributeWidget" company="KUNPO"></copyright>
// <summary></summary>
// ***********************************************************************
using TMPro;
using UnityEngine;
namespace G.UI
{
public class AttributeWidget : KUIWidget
{
private TextMeshProUGUI _attrText;
private void Awake()
{
_attrText = GetComponent<TextMeshProUGUI>();
}
public void SetData(string text, Color color)
{
_attrText.text = text;
_attrText.color = color;
}
public override void Refresh()
{
if (this.data is string attr)
{
_attrText.text = attr;
}
}
}
}