Trying to make a button in OnGui (c#) and I want the button to open a new rect(angle) and I have no idea how. I literally started learning last night so it’s probably something really simple I’m missing.
This is the code I have so far:
using UnityEngine;
using System.Collections;
public class Menu : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnGUI () {
GUI.Box (new Rect (640, 360, 640, 360), "Menu");
if (GUI.Button (new Rect (920, 390, 80, 20), "Inventory")) {
//Debug.Log("Does nothing yet");
GUI.Box (new Rect(10, 10, 200, 200), "inventory");
}
}
}
Thank you for your help