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.

34 lines
776 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
using UnityEngine.UI;
using XWFramework.Tools;
[RequireComponent(typeof(CanvasGroup))]
public class ErrorTip : MonoBehaviour
{
string content;
Text text;
float time;//持续时长
private void Awake()
{
text = GetComponentInChildren<Text>();
content = "回答错误请重试";
}
public void Show(float t = 2.5f)
{
StartCoroutine(new DialoguePlayer().IETextPlayer(content, (value) => { text.text = value; }));
time = t;
Invoke("CloseTip", time);
}
public void CloseTip()
{
gameObject.SetActive(false);
}
public void ChangeText(string text) {
content = text;
}
}