Hey guys, I am punching the “e” key which should tell the script to display the Inventory, but it doesn’t.
Anyone wanna take a crack at it? Thanks!
using UnityEngine;
using System.Collections;
public class GUIController : MonoBehaviour {
public bool shower = false;
public Texture2D myTexture;
void ShowInv () {
GUI.enabled = true;
}
void HideInv () {
GUI.enabled = false;
}
void Start () {
}
void Update () {
if (Input.GetKeyUp("e") && shower == false){
shower = true;
ShowInv();
}
if (Input.GetKeyUp("e") && shower == true){
shower = false;
HideInv();
}
if (shower == true){
GUI.skin.box.normal.background = myTexture;
GUI.Box(new Rect(Screen.width/2, Screen.height/2, 128, 128), "Inventory");
}
}
}