Im working to implement my RPG conversation system, which in previous projects (other engines) I managed with a whole game state. In Unity3d Im still trying to figure how how to handle it, but I decided to start witha simple box to display questions and choices. The problem is that GUI.Box is not displaying anything, using this code:
public class Dialog : MonoBehaviour {
private static bool render = false;
public static void ShowDialog(bool toggle){
render = toggle;
}
void OnGui() {
if (render) {
GUI.Box(new Rect(2, Screen.height-300, Screen.width-2, Screen.height-2), "Dialog");
}
}
}
The code that must show the box is this:
if (Input.GetKey (KeyCode.I))
Dialog.ShowDialog (true);
Can somebody see whats wrong here?