EventType.ValidateCommand 验证命令
Description描述
Validates a special command (e.g. copy & paste)
验证一个特殊的命令(如,拷贝,粘贴)。
"Copy", "Cut", "Paste", "Delete", "FrameSelected", "Duplicate", "SelectAll" and so on. Sent only in the editor.
"Copy", "Cut", "Paste", "Delete", "FrameSelected", "Duplicate", "SelectAll"等等,仅发送于编辑器。
Example: Make pasting work in current window or control:
例如:在当前窗口粘贴或控制:
function OnGUI()
{
var e:Event = Event.current;
if (e.type == EventType.ValidateCommand && e.commandName == "Paste")
{
Debug.Log("validate paste");
e.Use();
// without this line we won't get ExecuteCommand
//没有此行,我们不会得到ExecuteCommand
}
if (e.type == EventType.ExecuteCommand && e.commandName == "Paste")
{
Debug.Log("Pasting: " + EditorGUIUtility.systemCopyBuffer);
}
}
最后修改:2011年5月9日 Monday 14:42