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.
26 lines
607 B
26 lines
607 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;
|
|
public string Text => input.text;
|
|
|
|
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);
|
|
}
|
|
|