一、Editor状态下获取键盘鼠标输入
Editor代码中不能使用Input获取,需要使用Event
Event e = Event.current;
if(e.keyCode == KeyCode.Space)
{
}
二、Editor脚本中获取鼠标位置
Event e = Event.current;
Vector2 pos = e.mousePosition;
鼠标的坐标是左上为(0,0),因此需要转换
三、获取Editor窗口的Camera
Camera.current 。需要选中Editor窗口