DroneSimulator/Assets/Scripts/Hint.cs

29 lines
560 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Hint : MonoBehaviour
{
[SerializeField] private GameObject _content;
[SerializeField] private KeyCode _key;
[SerializeField] private GameObject _text;
private void Awake()
{
_content.SetActive(false);
_text.SetActive(true);
}
private void Update()
{
if (Input.GetKeyUp(_key))
{
_text.SetActive(!_text.activeSelf);
_content.SetActive(!_content.activeSelf);
}
}
}