浏览代码

Make PortInputView use pre-multiplied alpha background color and put its edge behind itself and node (still need to make it render behind other nodes)

/main
Peter Bay Bastian 7 年前
当前提交
ab14181b
共有 3 个文件被更改,包括 11 次插入10 次删除
  1. 1
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/MaterialNodeView.cs
  2. 18
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/PortInputView.cs
  3. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Resources/Styles/MaterialGraph.uss

1
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/MaterialNodeView.cs


inputContainer.Add(port);
var portInputView = new PortInputView(slot);
Add(portInputView);
mainContainer.BringToFront();
m_Attachers.Add(new Attacher(portInputView, port, SpriteAlignment.LeftCenter) { distance = -8f });
}
}

18
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/PortInputView.cs


m_SlotType = slot.concreteValueType;
AddToClassList("type" + m_SlotType);
m_EdgeControl = new EdgeControl
{
@from = new Vector2(212f - 21f, 11.5f),
to = new Vector2(212f, 11.5f),
edgeWidth = 2,
pickingMode = PickingMode.Ignore
};
Add(m_EdgeControl);
m_Container = new VisualElement { name = "container" };
{
m_Control = m_Slot.InstantiateControl();

m_Container.Add(slotElement);
}
Add(m_Container);
m_EdgeControl = new EdgeControl
{
@from = new Vector2(212f - 21f, 11.5f),
to = new Vector2(212f, 11.5f),
edgeWidth = 2,
pickingMode = PickingMode.Ignore
};
Add(m_EdgeControl);
m_Container.visible = m_EdgeControl.visible = m_Control != null;
m_Container.clippingOptions = ClippingOptions.ClipAndCacheContents;

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


}
PortInputView > #container {
background-color: #393939;
background-color: rgba(63, 63, 63, 0.8);
flex-direction: row;
align-items: center;
padding-left: 8;

正在加载...
取消
保存