Skip to content
Snippets Groups Projects
Commit 7142995e authored by billc27's avatar billc27
Browse files

feat: HU Display

parent 2b58b1d6
1 merge request!2No Damage Cheat, Twice Speed Cheat, Reset Cheat(s)
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using UnityEngine;
using UnityEngine.UI; // For Text
public class HUDisplay : MonoBehaviour
{
public GameObject messagePanel;
private Text textComponent;
[SerializeField] GameObject textInput;
private void Start()
{
// Find Text element on screen
textComponent = messagePanel.transform.Find("Text").GetComponent<Text>();
// False as default
messagePanel.SetActive(false);
textInput.SetActive(false);
}
public void OpenPanel(string text)
{
textComponent.text = text;
messagePanel.SetActive(true);
StartCoroutine(delayExec(2));
}
public void ClosePanel()
{
messagePanel.SetActive(false);
}
public void OpenInput()
{
textInput.SetActive(true);
}
public void CloseInput()
{
textInput.SetActive(false);
}
private IEnumerator delayExec(int sec)
{
yield return new WaitForSeconds(sec);
ClosePanel();
}
}
fileFormatVersion: 2
guid: eac3a012263105c48916d88caefde15d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment