Peter Bay Bastian
8 年前
当前提交
f1abf833
共有 9 个文件被更改,包括 137 次插入 和 19 次删除
-
21MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/DrawData/HeaderDrawData.cs
-
13MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/DrawData/NodeDrawData.cs
-
19MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Drawer/HeaderDrawer.cs
-
37MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Drawer/NodeDrawer.cs
-
1MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/SerializableGraphView.cs
-
7MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Runtime/Implementation/SerializableNode.cs
-
1MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/DrawData/MaterialNodeDrawData.cs
-
15MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Styles/MaterialGraph.uss
-
42MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Manipulators/NodeExpander.cs
|
|||
using System; |
|||
using RMGUI.GraphView; |
|||
using UnityEngine; |
|||
using UnityEngine.Graphing; |
|||
using UnityEngine.RMGUI; |
|||
|
|||
namespace UnityEditor.Graphing.Drawing |
|||
{ |
|||
public class NodeExpander : MouseManipulator |
|||
{ |
|||
public HeaderDrawData data; |
|||
private VisualElement initialTarget; |
|||
|
|||
public override EventPropagation HandleEvent(Event evt, VisualElement finalTarget) |
|||
{ |
|||
switch (evt.type) |
|||
{ |
|||
case EventType.MouseDown: |
|||
if (CanStartManipulation(evt)) |
|||
{ |
|||
this.TakeCapture(); |
|||
initialTarget = finalTarget; |
|||
} |
|||
break; |
|||
|
|||
case EventType.MouseUp: |
|||
if (CanStopManipulation(evt)) |
|||
{ |
|||
this.ReleaseCapture(); |
|||
var withinInitialTarget = initialTarget != null && initialTarget.ContainsPoint(evt.mousePosition); |
|||
if (true || withinInitialTarget) |
|||
{ |
|||
data.expanded = !data.expanded; |
|||
} |
|||
} |
|||
break; |
|||
|
|||
} |
|||
return this.HasCapture() ? EventPropagation.Stop : EventPropagation.Continue; |
|||
} |
|||
} |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue