EditorWindow.focusedWindow 焦点的窗口

static var focusedWindow : EditorWindow

Description描述

The EditorWindow which currently has keyboard focus (Read Only)

当前的哪一个编辑器窗口具有键盘焦点(只读)。

/focusedWindow/ can be null if no window has focus.

如果没有窗口具有焦点,focusedWindow可以为null。

参见: mouseOverWindow, Focus.

EditorWindow.focusedWindow 焦点的窗口

Focus other windows with a mouse click.
用鼠标点击焦点另一个窗口。

// Prints to a label the name of the focused window
//具有焦点窗口的名字,打印到标签

class focusedWindowEx extends EditorWindow {

	@MenuItem("Example/Print Focused Window Name")
	static function Init() {
		var window = GetWindow(focusedWindowEx);
		window.Show();
	}
	function OnGUI () {
		GUILayout.Label(EditorWindow.focusedWindow.ToString());
	}
}
最后修改:2011年6月24日 Friday 15:35

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。