You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
529 B
C#

using System.Collections;
using UnityEngine;
namespace Unity.Multiplayer.Samples.Utilities
{
public class AutoHide : MonoBehaviour
{
[SerializeField]
float m_TimeToHideSeconds = 5f;
// Start is called before the first frame update
void Start()
{
StartCoroutine(HideAfterSeconds());
}
IEnumerator HideAfterSeconds()
{
yield return new WaitForSeconds(m_TimeToHideSeconds);
gameObject.SetActive(false);
}
}
}