浏览代码

[shader graph]fix layout.

/main
Tim Cooper 9 年前
当前提交
ff4d4704
共有 4 个文件被更改,包括 66 次插入85 次删除
  1. 9
      UnityProject/Assets/UnityShaderEditor/Editor/Source/Drawing/DrawableMaterialNode.cs
  2. 2
      UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/Vector4Node.cs
  3. 84
      UnityProject/Assets/UnityShaderEditor/Graphs/GlowMud.ShaderGraph
  4. 56
      UnityProject/Assets/UnityShaderEditor/Graphs/LayeredTarp.ShaderGraph

9
UnityProject/Assets/UnityShaderEditor/Editor/Source/Drawing/DrawableMaterialNode.cs


pos.y += 22;
AddChild(new NodeAnchor(pos, typeof (Vector4), slot, data));
}
var inputYMax = pos.y;
var inputYMax = pos.y + 22;
// output port
pos.x = width;

pos.y += 22;
AddChild(new NodeOutputAnchor(pos, typeof (Vector4), slot, data));
}
pos.y += 22;
pos.y = Mathf.Max(pos.y, inputYMax) + 22.0f;
pos.y = Mathf.Max(pos.y, inputYMax);
var nodeUIHeight = m_Node.GetNodeUIHeight(width);
m_NodeUIRect = new Rect(10, pos.y, width - 20, nodeUIHeight);

{
m_PreviewArea = new Rect(10, pos.y, width - 20, width - 20);
pos.y += width;
pos.y += width - 20.0f;
scale = new Vector3(pos.x, pos.y + 22.0f, 0.0f);
scale = new Vector3(pos.x, pos.y + 10.0f, 0.0f);
KeyDown += OnDeleteNode;
OnWidget += MarkDirtyIfNeedsTime;

2
UnityProject/Assets/UnityShaderEditor/Editor/Source/Nodes/Vector4Node.cs


public override float GetNodeUIHeight(float width)
{
return EditorGUIUtility.singleLineHeight;
return 2*EditorGUIUtility.singleLineHeight;
}
public override bool NodeUI(Rect drawArea)

84
UnityProject/Assets/UnityShaderEditor/Graphs/GlowMud.ShaderGraph


style: node
position:
serializedVersion: 2
x: -1045.8572
y: 737.28
width: 647.8572
height: 14.719971
x: -1037.8572
y: 715.28
width: 639.8572
height: 36.71997
showEmptySlots: 1
m_SlotDefaultValues:
- m_DefaultVector: {x: 1, y: 1, z: 1, w: 1}

style: node
position:
serializedVersion: 2
x: 92.87264
y: -13.563602
width: 624.1274
height: 342.5636
x: 40.43891
y: -7.394927
width: 676.5611
height: 336.39493
showEmptySlots: 1
m_SlotDefaultValues:
- m_DefaultVector: {x: 1, y: 1, z: 1, w: 1}

style: node
position:
serializedVersion: 2
x: -44.66852
y: -848.0728
width: 397.73764
height: 263.7843
x: -32.66852
y: -901.0728
width: 385.73764
height: 316.7843
showEmptySlots: 1
m_SlotDefaultValues:
- m_DefaultVector: {x: 1, y: 1, z: 1, w: 1}

m_Title: Input 1
m_Name: Input1
m_DataTypeString:
- type: 0
m_Title: Input 2
m_Name: Input2
m_DataTypeString:
m_Properties: []
m_GenericTypeString:
color: 0

m_Editable: 1
m_SlotName: Input1
m_Node: {fileID: 11434830}
- m_DefaultVector: {x: 1, y: 1, z: 1, w: 1}
m_Editable: 1
m_SlotName: Input2
m_Node: {fileID: 11434830}
m_PrecisionNames:
- half
--- !u!114 &11441414

style: node
position:
serializedVersion: 2
x: -1043.2306
y: 660.08527
width: 645.2306
height: -40.085266
x: -1038.2306
y: 600.08527
width: 640.2306
height: 19.914734
showEmptySlots: 1
m_SlotDefaultValues:
- m_DefaultVector: {x: 1, y: 1, z: 1, w: 1}

- {fileID: 11451638}
- {fileID: 11422894}
- {fileID: 11459506}
- {fileID: 11428364}
- {fileID: 11434830}
edges:
- m_FromNode: {fileID: 11498308}
m_ToNode: {fileID: 11406334}

m_FromSlotName: Output
m_ToSlotName: UV
color: {r: 1, g: 1, b: 1, a: 1}
- m_FromNode: {fileID: 11428364}
m_ToNode: {fileID: 11434830}
m_FromSlotName: SinTime
m_ToSlotName: Input0
color: {r: 1, g: 1, b: 1, a: 1}
m_ToNode: {fileID: 11434830}
m_FromSlotName: Output
m_ToSlotName: Input1
color: {r: 1, g: 1, b: 1, a: 1}
- m_FromNode: {fileID: 11434830}
m_ToNode: {fileID: 11400400}
m_FromSlotName: Output
m_ToSlotName: Albedo

style: node
position:
serializedVersion: 2
x: -286.00098
y: -539.7324
width: 739.00104
height: 366.73242
x: -291.00098
y: -671.7324
width: 744.00104
height: 498.73242
showEmptySlots: 1
m_SlotDefaultValues:
- m_DefaultVector: {x: 1, y: 1, z: 1, w: 1}

style: node
position:
serializedVersion: 2
x: -2271.2732
y: -318.42752
width: 1465.2732
height: 398.42755
x: -2171.0325
y: -310.71664
width: 1365.0325
height: 390.71667
showEmptySlots: 1
m_SlotDefaultValues:
- m_DefaultVector: {x: 1, y: 1, z: 1, w: 1}

style: node
position:
serializedVersion: 2
x: -286.00098
y: -383.7324
width: 739.00104
height: 366.7324
x: -293.00098
y: -372.7324
width: 746.00104
height: 355.7324
showEmptySlots: 1
m_SlotDefaultValues:
- m_DefaultVector: {x: 1, y: 1, z: 1, w: 1}

style: node
position:
serializedVersion: 2
x: -286.00098
y: -239.73224
width: 739.00104
height: 366.73224
x: -287.00098
y: -80.73224
width: 740.00104
height: 207.73224
showEmptySlots: 1
m_SlotDefaultValues:
- m_DefaultVector: {x: 1, y: 1, z: 1, w: 1}

56
UnityProject/Assets/UnityShaderEditor/Graphs/LayeredTarp.ShaderGraph


style: node
position:
serializedVersion: 2
x: 286.73352
x: 291.73352
width: 735.2665
width: 730.2665
height: -26.974396
showEmptySlots: 1
m_SlotDefaultValues:

style: node
position:
serializedVersion: 2
x: -1063.1451
y: -241.84991
width: 1101.145
height: 454.85022
x: -1074.1451
y: -175.84991
width: 1112.145
height: 388.85022
showEmptySlots: 1
m_SlotDefaultValues:
- m_DefaultVector: {x: 1, y: 1, z: 1, w: 1}

style: node
position:
serializedVersion: 2
x: 293.37222
y: 611.4138
width: 63.62796
height: 31.586182
x: 292.37222
y: 741.4138
width: 64.62796
height: -98.41382
showEmptySlots: 1
m_SlotDefaultValues:
- m_DefaultVector: {x: 1, y: 1, z: 1, w: 1}

style: node
position:
serializedVersion: 2
x: -544.1203
y: 155.57974
width: 901.1207
height: 199.42026
x: -540.1203
y: 173.57974
width: 897.1207
height: 181.42026
showEmptySlots: 1
m_SlotDefaultValues:
- m_DefaultVector: {x: 1, y: 1, z: 1, w: 1}

style: node
position:
serializedVersion: 2
x: 5.5296288
y: -130.32156
width: 812.4704
height: 139.32155
x: 12.529629
y: -195.32156
width: 805.4704
height: 204.32155
showEmptySlots: 1
m_SlotDefaultValues:
- m_DefaultVector: {x: 1, y: 1, z: 1, w: 1}

position:
serializedVersion: 2
x: -473.71893
y: -176.64322
y: -197.64322
height: 125.64322
height: 146.64322
showEmptySlots: 1
m_SlotDefaultValues:
- m_DefaultVector: {x: 1, y: 1, z: 1, w: 1}

style: node
position:
serializedVersion: 2
x: -243.78564
y: -68.14007
width: 841.78564
height: 100.14006
x: -231.78564
y: -102.140076
width: 829.78564
height: 134.14008
showEmptySlots: 1
m_SlotDefaultValues:
- m_DefaultVector: {x: 1, y: 1, z: 1, w: 1}

style: node
position:
serializedVersion: 2
x: 843.8631
y: 633.56647
width: -6.863098
height: 103.43353
x: 822.81683
y: 665.1358
width: 14.1831665
height: 71.8642
showEmptySlots: 1
m_SlotDefaultValues:
- m_DefaultVector: {x: 1, y: 1, z: 1, w: 1}

正在加载...
取消
保存