浏览代码

Merge pull request #1424 from Unity-Technologies/sg/fix-create-node-using-spacebar

Fix for node creation on spacebar
/main
GitHub 7 年前
当前提交
b3577726
共有 1 个文件被更改,包括 1 次插入12 次删除
  1. 13
      com.unity.shadergraph/Editor/Drawing/Views/GraphEditorView.cs

13
com.unity.shadergraph/Editor/Drawing/Views/GraphEditorView.cs


void OnSpaceDown(KeyDownEvent evt)
{
if (evt.keyCode == KeyCode.Space && !evt.shiftKey && !evt.altKey && !evt.ctrlKey && !evt.commandKey)
{
if (graphView.nodeCreationRequest == null)
return;
Vector2 referencePosition;
referencePosition = evt.imguiEvent.mousePosition;
Vector2 screenPoint = m_EditorWindow.position.position + referencePosition;
graphView.nodeCreationRequest(new NodeCreationContext() { screenMousePosition = screenPoint });
}
else if (evt.keyCode == KeyCode.F1)
if (evt.keyCode == KeyCode.F1)
{
if (m_GraphView.selection.OfType<MaterialNodeView>().Count() == 1)
{

正在加载...
取消
保存