Files
unity-vr-development/SurvivalIsland/Assets/Scripts/TextHints.cs
T
2025-04-10 19:05:55 +08:00

31 lines
464 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;
}
}
}