using System.Collections; using System.Collections.Generic; using UnityEngine; using DG.Tweening; using UnityEngine.UI; public class ErrorTip : MonoBehaviour { Text text; float time;//³ÖÐøʱ³¤ private void Awake() { text = GetComponentInChildren(); } public void InitThis(string content,float t=2.5f) { GetComponent().alpha = 1; GetComponentInChildren().PlayText(content,0.02f); time = t; Invoke("CloseTip", time); } public void CloseTip() { GetComponent().alpha = 0; } }