Unity3d Gui.windowwon';我们不能团结一致
我有如下代码:Unity3d Gui.windowwon';我们不能团结一致,unity3d,unityscript,Unity3d,Unityscript,我有如下代码: if( GUI.Button( new Rect(Screen.width/4f,50f,Screen.width/2f,Screen.height/9f),"RessetLevel")) { showingWinsows = true; if(showingWinsows) { rectWindow = GUI.Window( 0, rectWindow, DoMyWindow,
if( GUI.Button(
new Rect(Screen.width/4f,50f,Screen.width/2f,Screen.height/9f),"RessetLevel")) {
showingWinsows = true;
if(showingWinsows)
{
rectWindow = GUI.Window(
0,
rectWindow,
DoMyWindow,
"Are you sure you want to reset All level ?"
);
}
我插入了
userGuiLayout=false我的Awake()
函数中的code>。但是窗户还是不亮。如何解决此问题?问题是,仅当按下按钮时才会绘制窗口
您需要将检查标志的代码移出if(GUI.Button),如下所示:
if( GUI.Button(new Rect(Screen.width/4f,50f,Screen.width/2f,Screen.height/9f),"Resset Level"))
{
showingWinsows = true;
}
if(showingWinsows)
{
rectWindow = GUI.Window(0,rectWindow,DoMyWindow,"Are you sure you want to reset All level ?");
}