- 最后登录
- 2019-12-25
- 注册时间
- 2012-8-24
- 阅读权限
- 90
- 积分
- 71088
- 纳金币
- 52336
- 精华
- 343
|
单击物体弹出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为什么是不知道的标识符? |
|