_xiaofang/xiaofang/Assets/Bitsplash/Modular Date Picker/Base/Script/TextMediator.cs
2024-11-29 16:19:12 +08:00

33 lines
803 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.UI;
namespace Bitsplash.DatePicker
{
partial class TextMediator : MonoBehaviour
{
partial void MediateTextMeshProText(string text);
partial void MediateTextMeshProColor(Color color);
public void SetText(string text)
{
MediateTextMeshProText(text);
var comp = GetComponent<Text>();
if (comp != null)
comp.text = text;
}
public void SetColor(Color color)
{
MediateTextMeshProColor(color);
var comp = GetComponent<Text>();
if (comp != null)
comp.color = color;
}
}
}