Hi,
I read some threads on this forum about this error but I still can not solve it.
Here is my code that create this error when I click on the button, if somebody could help me :
using UnityEngine;
using System.Collections;
public class Test : MonoBehaviour {
private bool isFlee = false;
private Rect fleeWindow;
public GUISkin fantasyGUI;
void Awake ()
{
fleeWindow = new Rect((Screen.width / 2) - (400 / 2), (Screen.height / 2) - (400 / 2), 400, 400);
}
void OnGUI (){
GUI.skin = fantasyGUI;
if (GUI.RepeatButton(new Rect(100, 200, 200, 50), "Click me") isFlee == false)
{
isFlee = true;
}
if (isFlee == true)
{
fleeWindow = GUI.Window(0, fleeWindow, DrawFleeWindow, "");
}
}
void DrawFleeWindow(int windowID)
{
GUILayout.Box("Do you really want to flee?");
if (GUILayout.RepeatButton("YES"))
{
}
if (GUILayout.RepeatButton("NO"))
{
isFlee = false;
}
}
}
Thanks in advance and sorry to throw some code like that,
Cizia
