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(); 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; } }