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