AkiraPixelWind/Assets/Scripts/Main/UI/UIMgr/UIAutoClose.cs

21 lines
420 B
C#
Raw Permalink Normal View History

2022-12-29 18:20:40 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UIAutoClose : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
StartCoroutine(AutoClose());
}
IEnumerator AutoClose()
{
yield return 0;
yield return new WaitForSeconds(2.5f);
if(gameObject)
gameObject.SetActive(false);
}
}