using System.Collections; using System.Collections.Generic; using UnityEngine; using DG.Tweening; using UnityEngine.UI; public class ErrorTip : MonoBehaviour { Text text; Image img; float time;//³ÖÐøʱ³¤ private void Awake() { text = GetComponentInChildren(); img = GetComponentInChildren(); } public void InitThis(string content,float t=2f) { text.text = content; time = t; Invoke("CloseTip", time); } void CloseTip() { transform.parent.gameObject.SetActive(false); } }