浏览代码

Fix MaterialGraph to match updated Unity changes

Signed-off-by: joce <joce@unity3d.com>
/main
joce 8 年前
当前提交
64bf0c23
共有 6 个文件被更改,包括 12 次插入9 次删除
  1. 1
      MaterialGraphProject/Assets/NewUI/Editor/Elements/NodeAnchor.cs
  2. 2
      MaterialGraphProject/Assets/NewUI/Editor/Manipulators/ContentDragger.cs
  3. 6
      MaterialGraphProject/Assets/NewUI/Editor/Manipulators/Resizer.cs
  4. 5
      MaterialGraphProject/Assets/NewUI/Editor/Views/GraphView.cs
  5. 5
      MaterialGraphProject/Assets/NewUI/Editor/Views/GraphView.uss
  6. 2
      MaterialGraphProject/ProjectSettings/ProjectVersion.txt

1
MaterialGraphProject/Assets/NewUI/Editor/Elements/NodeAnchor.cs


string anchorName = string.IsNullOrEmpty(anchorPresenter.name) ? anchorType.Name : anchorPresenter.name;
m_ConnectorText.content.text = anchorName;
anchorPresenter.capabilities &= ~Capabilities.Selectable;
}

2
MaterialGraphProject/Assets/NewUI/Editor/Manipulators/ContentDragger.cs


break;
case EventType.MouseDrag:
if (this.HasCapture() && graphView.contentViewContainer.positionType == PositionType.Absolute)
if (this.HasCapture())
{
Vector2 diff = graphView.ChangeCoordinatesTo(graphView.contentViewContainer, evt.mousePosition) - m_Start;
Matrix4x4 t = graphView.contentViewContainer.transform;

6
MaterialGraphProject/Assets/NewUI/Editor/Manipulators/Resizer.cs


m_Start = this.ChangeCoordinatesTo(parent,evt.mousePosition);
m_StartPos = parent.position;
// Warn user if target uses a relative CSS position type
if (parent.positionType != PositionType.Absolute)
if (parent.positionType != PositionType.Manual)
Debug.LogWarning("Attempting to resize an object with a non absolute CSS position type");
Debug.LogWarning("Attempting to resize an object with a non manual position");
}
this.TakeCapture();
return EventPropagation.Stop;

case EventType.MouseDrag:
if (this.HasCapture() && parent.positionType == PositionType.Absolute)
if (this.HasCapture() && parent.positionType == PositionType.Manual)
{
Vector2 diff = this.ChangeCoordinatesTo(parent,evt.mousePosition) - m_Start;
var newSize = new Vector2(m_StartPos.width + diff.x, m_StartPos.height + diff.y);

5
MaterialGraphProject/Assets/NewUI/Editor/Views/GraphView.cs


{
name = "contentViewContainer",
clipChildren = false,
position = new Rect(0, 0, 0, 0)
pickingMode = PickingMode.Ignore
};
// make it absolute and 0 sized so it acts as a transform to move children to and fro

{
// Reset container translation, scale and position
contentViewContainer.transform = Matrix4x4.identity;
contentViewContainer.position = Rect.zero;
// TODO remove once we clarify Touch()
contentViewContainer.Touch(ChangeType.Repaint);
if (frameType == FrameType.Origin)
{

5
MaterialGraphProject/Assets/NewUI/Editor/Views/GraphView.uss


}
.node.horizontal > #pane {
flex:1;
align-items: stretch;
border-left: 4;
border-top: 4;

.node NodeAnchor #type {
text-color: rgb(153, 153, 153);
}
.node.vertical NodeAnchor #type {
flex:1;
}

2
MaterialGraphProject/ProjectSettings/ProjectVersion.txt


m_EditorVersion: 5.6.0a2
m_EditorVersion: 5.6.0a5
正在加载...
取消
保存