浏览代码

Improved node collapsing performance a lot

/main
Peter Bay Bastian 8 年前
当前提交
190ab48a
共有 3 个文件被更改,包括 26 次插入11 次删除
  1. 33
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Drawer/NodeDrawer.cs
  2. 2
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Manipulators/NodeExpander.cs
  3. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Styles/MaterialGraph.uss

33
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Drawer/NodeDrawer.cs


{
var headerData = nodeData.elements.OfType<HeaderDrawData>().FirstOrDefault();
if (headerData == m_HeaderData || headerData == null)
if (m_HeaderData == headerData)
return;
m_HeaderDrawer.Touch(ChangeType.Repaint);
if (m_HeaderData != null)
RemoveChild(m_HeaderDrawer);
m_HeaderDrawer = new HeaderDrawer(headerData);
InsertChild(0, m_HeaderDrawer);
m_HeaderData = headerData;
else if (m_HeaderData != null)
{
m_HeaderDrawer.dataProvider = headerData;
m_HeaderData = headerData;
}
else
{
m_HeaderDrawer = new HeaderDrawer(headerData);
InsertChild(0, m_HeaderDrawer);
m_HeaderData = headerData;
}
}
private void AddSlots(NodeDrawData nodeData)

ClearChildren();
AddContainers();
return;
}
if (!nodeData.expanded)
{
if (!classList.Contains("collapsed"))
AddToClassList("collapsed");
}
else
{
if (classList.Contains("collapsed"))
RemoveFromClassList("collapsed");
}
AddHeader(nodeData);

2
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Manipulators/NodeExpander.cs


{
this.ReleaseCapture();
var withinInitialTarget = initialTarget != null && initialTarget.ContainsPoint(evt.mousePosition);
if (true || withinInitialTarget)
if (withinInitialTarget)
{
data.expanded = !data.expanded;
}

2
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Styles/MaterialGraph.uss


position-type: absolute;
position-top: 0;
position-left: 5;
background-color: #000;
height: 14;
}
MaterialNodeDrawer #slots {

正在加载...
取消
保存