Files
unity-vr-development/SurvivalIsland/Assets/Scripts/TextHints.cs
T
2025-03-20 08:35:10 +08:00

31 lines
429 B
C#

using UnityEngine;
using System.Collections;
public class TextHints : MonoBehaviour
{
float timer = 0.0f;
// Update is called once per frame
void Update()
{
if (guiText.enabled)
{
timer += Time.deltaTime;
if (timer >= 4)
{
guiText.enabled = false;
timer = 0.0f;
}
}
}
void ShowHint(string message)
{
guiText.text = message;
if (!guiText.enabled)
{
guiText.enabled = true;
}
}
}