浏览代码
[shader graph]
[shader graph]
*Unified deletion architecture - Delete edges before nodes *Input proxies now aware of their type *Fix shader builder bug when mapping from vector1 -> vector2. Some compilers need this to be explicit )swizzle with .xx)./main
Tim Cooper
9 年前
当前提交
6aaca4fc
共有 13 个文件被更改,包括 187 次插入 和 39 次删除
-
10UnityProject/Assets/UnityShaderEditor/Editor/Source/BaseMaterialGraph.cs
-
15UnityProject/Assets/UnityShaderEditor/Editor/Source/Drawing/DrawableMaterialNode.cs
-
41UnityProject/Assets/UnityShaderEditor/Editor/Source/Drawing/MaterialGraphDataSource.cs
-
2UnityProject/Assets/UnityShaderEditor/Editor/Source/Drawing/MaterialWindow.cs
-
5UnityProject/Assets/UnityShaderEditor/Editor/Source/Drawing/NullInputProxy.cs
-
12UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/BaseMaterialNode.cs
-
4UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/PixelShaderNode.cs
-
42UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/SlotValue.cs
-
17UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/TextureNode.cs
-
6UnityProject/Assets/UnityShaderEditor/Editor/Source/Util/ShaderGenerator.cs
-
48UnityProject/Assets/UnityShaderEditor/Editor/Source/Drawing/DeleteSelected.cs
-
12UnityProject/Assets/UnityShaderEditor/Editor/Source/Drawing/DeleteSelected.cs.meta
-
12UnityProject/Assets/UnityShaderEditor/Editor/Source/Drawing/NullInputProxy.cs.meta
|
|||
using System.Collections.Generic; |
|||
using UnityEditor.Experimental; |
|||
using UnityEngine; |
|||
|
|||
namespace UnityEditor.MaterialGraph |
|||
{ |
|||
internal class DeleteSelected : IManipulate |
|||
{ |
|||
public delegate void DeleteElements(List<CanvasElement> elements); |
|||
|
|||
private readonly DeleteElements m_DeletionCallback; |
|||
private readonly Canvas2D m_Canvas; |
|||
|
|||
public DeleteSelected(DeleteElements deletionCallback, Canvas2D canvas) |
|||
{ |
|||
m_DeletionCallback = deletionCallback; |
|||
m_Canvas = canvas; |
|||
} |
|||
|
|||
public bool GetCaps(ManipulatorCapability cap) |
|||
{ |
|||
return false; |
|||
} |
|||
|
|||
public void AttachTo(CanvasElement element) |
|||
{ |
|||
element.KeyDown += KeyDown; |
|||
} |
|||
|
|||
private bool KeyDown(CanvasElement element, Event e, Canvas2D parent) |
|||
{ |
|||
if (e.type == EventType.Used) |
|||
return false; |
|||
|
|||
if (e.keyCode == KeyCode.Delete) |
|||
{ |
|||
if (m_DeletionCallback != null) |
|||
{ |
|||
m_DeletionCallback(parent.selection); |
|||
m_Canvas.ReloadData(); |
|||
m_Canvas.Repaint(); |
|||
return true; |
|||
} |
|||
} |
|||
return false; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: dbefa7b7bc23a744ba3dc453069378ef |
|||
timeCreated: 1454513094 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: ac2d0360e4cfc7745858846ff9b8ff24 |
|||
timeCreated: 1453989550 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue