纳金网

标题: 单击物体弹出对话框 [打印本页]

作者: may    时间: 2013-6-30 01:12
标题: 单击物体弹出对话框
单击物体弹出Gui对话框static var WindowSwitch :boolean = false;
var mySkin : GUISkin;var windowRect = Rect (200, 80, 240, 100);
function OnGUI ()
{
if(WindowSwitch == true)
{ GUI.skin = mySkin;
windowRect = GUI.Window (0, windowRect, WindowContain, "测试视窗");
}
}
function WindowContain (windowID : int)
{
if (GUI.Button (Rect (70,40,100,20), "关闭视窗"))
{ WindowSwitch = false;
}
}
function OnMouseEnter ()
{ renderer.material.color = Color.red;
}
function OnMouseDown ()
{ Func_GUIWindow.WindowSwitch =true;
}
function OnMouseExit ()
{ renderer.material.color = Color.white;
}

运行出错:BCE0005: Unknown identifier: 'Func_GUIWindow'.
在鼠标按下事件OnMouseDown()中 Func_GUIWindow为什么是不知道的标识符?




欢迎光临 纳金网 (http://rs.narkii.com/club/) Powered by Discuz! X2.5