Scriptum/Assets/DisplayHealthStatus.cs

34 lines
686 B
C#
Raw Normal View History

using System;
2022-12-18 19:19:57 +01:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class DisplayHealthStatus : MonoBehaviour
{
public GameObject healthText;
public static KeyCode keyToHealth;
2022-12-18 19:19:57 +01:00
private void Start()
{
DisplayExpStatus.keyToExp = (KeyCode) System.Enum.Parse(typeof(KeyCode), PlayerPrefs.GetString("EXP HEALTH"));
}
2022-12-18 19:19:57 +01:00
// Update is called once per frame
void Update()
{
2022-12-18 19:19:57 +01:00
if (Input.GetKeyDown(keyToHealth))
2022-12-18 19:19:57 +01:00
{
healthText.SetActive(true);
}
if (Input.GetKeyUp(keyToHealth))
2022-12-18 19:19:57 +01:00
{
healthText.SetActive(false);
}
}
}