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.

26 lines
574 B

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<Text>();
img = GetComponentInChildren<Image>();
}
public void InitThis(string content,float t=2f) {
text.text = content;
time = t;
Invoke("CloseTip", time);
}
void CloseTip() {
transform.parent.gameObject.SetActive(false);
}
}