浏览代码
Merge pull request #133 from Unity-Technologies/inspector-preview-mesh
Merge pull request #133 from Unity-Technologies/inspector-preview-mesh
Inspector preview mesh/main
GitHub
7 年前
当前提交
1f3752d8
共有 5 个文件被更改,包括 21 次插入 和 65 次删除
-
10MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Graphs/AbstractMaterialGraph.cs
-
16MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/GraphInspectorView.cs
-
15MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/PreviewManager.cs
-
34MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Manipulators/Scrollable.cs
-
11MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Manipulators/Scrollable.cs.meta
|
|||
using System; |
|||
using UnityEngine.Experimental.UIElements; |
|||
|
|||
namespace UnityEditor.ShaderGraph.Drawing |
|||
{ |
|||
public class Scrollable : MouseManipulator |
|||
{ |
|||
Action<float> m_Handler; |
|||
|
|||
public Scrollable(Action<float> handler) |
|||
{ |
|||
m_Handler = handler; |
|||
activators.Add(new ManipulatorActivationFilter() |
|||
{ |
|||
button = MouseButton.LeftMouse |
|||
}); |
|||
} |
|||
|
|||
protected override void RegisterCallbacksOnTarget() |
|||
{ |
|||
target.RegisterCallback(new EventCallback<WheelEvent>(OnMouseWheel), Capture.NoCapture); |
|||
} |
|||
|
|||
protected override void UnregisterCallbacksFromTarget() |
|||
{ |
|||
target.UnregisterCallback(new EventCallback<WheelEvent>(OnMouseWheel), Capture.NoCapture); |
|||
} |
|||
|
|||
void OnMouseWheel(WheelEvent evt) |
|||
{ |
|||
m_Handler(evt.delta.y); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 1fde0872f0455304bb082dbee731fabf |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue