浏览代码

Merge pull request #41 from stramit/crash-fixes

Crash fixes
/main
GitHub 7 年前
当前提交
ea281f24
共有 4 个文件被更改,包括 13 次插入7 次删除
  1. 2
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/AbstractGraphEditWindow.cs
  2. 14
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/SerializableGraphView.cs
  3. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphEditWindow.cs
  4. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphView.cs

2
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/AbstractGraphEditWindow.cs


public virtual GraphView CreateGraphView()
{
return new SerializableGraphView();
return new SerializableGraphView(this);
}
void OnEnable()

14
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/SerializableGraphView.cs


// TODO JOCE Maybe bring SimpleGraphView public. This implements pretty much all that it does.
public class SerializableGraphView : GraphView
{
public SerializableGraphView()
private ShortcutHandler m_ShortcutHandler;
private EditorWindow m_EditorWindow;
public SerializableGraphView(EditorWindow editorWindow)
// Shortcut handler to delete elements
this.AddManipulator(new ShortcutHandler(
m_EditorWindow = editorWindow;
m_ShortcutHandler = new ShortcutHandler(
new Dictionary<Event, ShortcutDelegate>
{
{Event.KeyboardEvent("a"), FrameAll},

{Event.KeyboardEvent("#c"), CopySelection},
{Event.KeyboardEvent("#v"), Paste},
{Event.KeyboardEvent("#d"), DuplicateSelection}
}));
});
onEnter += () => m_EditorWindow.rootVisualContainer.parent.AddManipulator(m_ShortcutHandler);
onLeave += () => m_EditorWindow.rootVisualContainer.parent.RemoveManipulator(m_ShortcutHandler);
this.AddManipulator(new Commandable
{

2
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphEditWindow.cs


public override GraphView CreateGraphView()
{
return new MaterialGraphView();
return new MaterialGraphView(this);
}
}
}

2
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphView.cs


{
public class MaterialGraphView : SerializableGraphView
{
public MaterialGraphView()
public MaterialGraphView(EditorWindow editorWindow) : base(editorWindow)
{
RegisterCallback<MouseUpEvent>(DoContextMenu);

正在加载...
取消
保存