You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

25 lines
569 B

using TMPro;
using UnityEngine;
public class RS_InputField : RS_LabeledComponent
{
[SerializeField] private TMP_InputField input;
[SerializeField] private Animator animator;
public bool IsEmpty => input.text.Length == 0;
protected override void OnUpdateLabel()
{
input.placeholder.GetComponent<TMP_Text>().text = label;
}
public void UpdateAnimator()
{
animator.SetBool("IsEmpty", IsEmpty);
}
public void Set(string text)
{
input.text = text;
}
public void Clear() => Set(string.Empty);
}