36 lines
782 B
C#
36 lines
782 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
|
|
using TMPro;
|
|
using DG.Tweening;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using Cysharp.Threading.Tasks;
|
|
|
|
public class UIInputField : MonoBehaviour
|
|
{
|
|
[SerializeField] private Image _outline;
|
|
[SerializeField] private TMP_Text _text;
|
|
private TMP_InputField _inputField;
|
|
|
|
private void Start()
|
|
{
|
|
_inputField = GetComponent<TMP_InputField>();
|
|
}
|
|
|
|
public async UniTaskVoid ShowErrorAsync(string text)
|
|
{
|
|
Color startColor = _outline.color;
|
|
Color textColor = _text.color;
|
|
textColor.a = 1;
|
|
|
|
_text.text = text;
|
|
_text.DOFade(1, .25f);
|
|
|
|
await UniTask.Delay(2000);
|
|
|
|
_outline.DOColor(startColor, .25f);
|
|
_text.DOFade(0, .25f);
|
|
}
|
|
}
|