Files
unity-vr-development/SurvivalIsland/Assets/Scripts/TextHints.cs
T
2025-04-11 09:56:51 +08:00

38 lines
484 B
C#

using UnityEngine;
using System.Collections;
public class TextHints : MonoBehaviour
{
float timer = 0.0f;
// Use this for initialization
void Start()
{
}
// 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;
}
}
}