토글 버튼이있는 팝업으로 GUI.Window를 여는 다음 스크립트가 있습니다. Unity3d 에디터 플레이어에서 스크립트는 o.k를 실행합니다. 토글 버튼을 클릭하면 윈도우가 닫힙니다. 장면을 Android 장치로 컴파일하면 스크립트가 실행되지만 토글 버튼을 터치하는 것만으로 GUI.Window를 열 수 있습니다. 버튼을 다시 터치해도 닫을 수 없습니다.Unity의 GUI.Toggle 버튼이 팝업 창을 닫지 않습니다.
스크립트를 살펴보고 왜 이런 일이 일어나는지 조언 해주십시오. 이 UnityScript에 어떤 문제가 있습니까? 미리 감사드립니다. 아무도 아직 아무것도 게시되지 않았기 때문에
#pragma strict
private var doWindow0 : boolean = false;
var aTexture : Texture;
var wTexture : Texture;
// Make the contents of the window.
function DoWindow0 (windowID : int) {
GUI.color = Color.cyan;
GUI.Box (new Rect (10,10,415,210),wTexture);
}
function OnGUI() {
if(!aTexture) {
Debug.LogError("Please assign a texture in the inspector.");
return;
}
// Make a toggle button for hiding and showing the window
doWindow0 = GUI.Toggle(Rect(210,210,70,20), doWindow0, aTexture);
//doWindow0 = GUI.Button (new Rect (10,10,100,20), doWindow0, "InfoBox");
// Make sure we only call GUI.Window if doWindow0 is true.
if (doWindow0)
GUI.Window (0, Rect (30,0,420,215), DoWindow0, "InfoBox");
// Make the windows be draggable.
GUI.DragWindow (Rect (0,0,10000,10000));
}