LaboratoryProtection/Assets/UnityTest/EditorUITool/Scripts/Setter/TMPTextSetter.cs

28 lines
513 B
C#
Raw Normal View History

2023-09-12 15:55:51 +08:00
using Cysharp.Threading.Tasks;
using PMaker.Extension;
using Sirenix.OdinInspector;
using System.Linq;
using TMPro;
public class TMPTextSetter : SetterBase<TextMeshProUGUI, string>
{
#if UNITY_EDITOR
protected override void Set(TextMeshProUGUI behaviour, string value)
{
behaviour.text = value;
}
[Button]
public void GetCurrentValue()
{
var strs = this.behaviours.Select(_ => _.text);
this.values = strs.ToArray();
this.SetDirty();
}
#endif
}