浏览代码

[Mat Graph]More porting to new CSS

/main
Tim Cooper 8 年前
当前提交
f6ff69e4
共有 31 个文件被更改,包括 2342 次插入94 次删除
  1. 50
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/DrawData/AnchorDrawData.cs
  2. 38
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Drawer/NodeDrawer.cs
  3. 31
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Manipulators/EdgeConnector.cs
  4. 1
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/SerializableGraphView.cs
  5. 257
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Styles/SerializableGraph.uss.imported.asset
  6. 4
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Styles/SerializableGraph.uss.imported.asset.meta
  7. 4
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Styles/SerializableGraph.uss.meta
  8. 604
      MaterialGraphProject/Assets/NewUI/Editor/Demo/Views/NodalView.uss.imported.asset
  9. 2
      MaterialGraphProject/Assets/NewUI/Editor/Demo/Views/NodalView.uss.imported.asset.meta
  10. 2
      MaterialGraphProject/Assets/NewUI/Editor/Demo/Views/NodesContentView.cs
  11. 2
      MaterialGraphProject/Assets/NewUI/Editor/Demo/Views/SimpleContentView.cs
  12. 246
      MaterialGraphProject/Assets/NewUI/Editor/Demo/Views/SimpleContentView.uss.imported.asset
  13. 2
      MaterialGraphProject/Assets/NewUI/Editor/Demo/Views/SimpleContentView.uss.imported.asset.meta
  14. 2
      MaterialGraphProject/Assets/NewUI/Editor/Views/GraphView.cs
  15. 2
      MaterialGraphProject/Assets/NewUI/Editor/Views/GraphView.uss
  16. 74
      MaterialGraphProject/Assets/NewUI/Editor/Views/GraphView.uss.imported.asset
  17. 2
      MaterialGraphProject/Assets/NewUI/Editor/Views/GraphView.uss.imported.asset.meta
  18. 1
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Drawer/MaterialNodeDrawer.cs
  19. 3
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphView.cs
  20. 64
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Styles/MaterialGraph.uss
  21. 539
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Styles/MaterialGraph.uss.imported.asset
  22. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Styles/MaterialGraph.uss.imported.asset.meta
  23. 6
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Styles/MaterialGraph.uss.meta
  24. 9
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/COPIED.meta
  25. 218
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/COPIED/GridBackground.cs
  26. 12
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/COPIED/GridBackground.cs.meta
  27. 104
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/COPIED/NodeAnchor.cs
  28. 12
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/COPIED/NodeAnchor.cs.meta
  29. 131
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/COPIED/NodeAnchorData.cs
  30. 12
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/COPIED/NodeAnchorData.cs.meta

50
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/DrawData/AnchorDrawData.cs


using System;
using RMGUI.GraphView;
using RMGUI.GraphView.Demo;
internal static class MyNodeAdapters
{
internal static bool Adapt(this NodeAdapter value, PortSource<int> a, PortSource<int> b)
{
// run adapt code for int to int connections
return true;
}
internal static bool Adapt(this NodeAdapter value, PortSource<float> a, PortSource<float> b)
{
// run adapt code for float to float connections
return true;
}
internal static bool Adapt(this NodeAdapter value, PortSource<int> a, PortSource<float> b)
{
// run adapt code for int to float connections, perhaps by insertion a conversion node
return true;
}
internal static bool Adapt(this NodeAdapter value, PortSource<Vector3> a, PortSource<Vector3> b)
{
// run adapt code for vec3 to vec3 connections
return true;
}
internal static bool Adapt(this NodeAdapter value, PortSource<Color> a, PortSource<Color> b)
{
// run adapt code for Color to Color connections
return true;
}
internal static bool Adapt(this NodeAdapter value, PortSource<Vector3> a, PortSource<Color> b)
{
// run adapt code for vec3 to Color connections
return true;
}
internal static bool Adapt(this NodeAdapter value, PortSource<Color> a, PortSource<Vector3> b)
{
// run adapt code for Color to vec3 connections
return true;
}
internal static bool Adapt(this NodeAdapter value, PortSource<Vector4> a, PortSource<Vector4> b)
{
return true;
}
}
[Serializable]
public class AnchorDrawData : NodeAnchorData
{

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


using System.Collections.Generic;
using System.Linq;
using RMGUI.GraphView;
using RMGUI.GraphView.Demo;
using UnityEngine;
using UnityEngine.RMGUI;
using UnityEditor.Graphing.Util;

[GUISkinStyle("window")]
List<NodeAnchorData> m_currentAnchors;
List<AnchorDrawData> m_currentAnchors;
VisualContainer m_ControlsContainer;
List<ControlDrawData> m_currentControlDrawData;

private void AddContainers()
{
AddSlotsContainer();
m_currentAnchors = new List<NodeAnchorData>();
// Add controls container
m_ControlsContainer = new VisualContainer
{
name = "controls", // for USS&Flexbox
pickingMode = PickingMode.Ignore,
};
AddChild(m_ControlsContainer);
m_currentControlDrawData = new List<ControlDrawData>();
}
private void AddSlotsContainer()
{
// Add slots (with input & output sub-containers) container
m_SlotContainer = new VisualContainer
{

AddChild(m_SlotContainer);
var inputs = new VisualContainer
{

};
m_SlotContainer.AddChild(outputs);
AddChild(m_SlotContainer);
m_currentAnchors = new List<AnchorDrawData>();
// Add controls container
m_ControlsContainer = new VisualContainer
{
name = "controls", // for USS&Flexbox
pickingMode = PickingMode.Ignore,
};
AddChild(m_ControlsContainer);
m_currentControlDrawData = new List<ControlDrawData>();
var anchors = nodeData.elements.OfType<NodeAnchorData>().ToList();
var anchors = nodeData.elements.OfType<AnchorDrawData>().ToList();
if (anchors.Count == 0)
return;

inputsContainer.ClearChildren();
outputsContainer.ClearChildren();
foreach (var anchor in nodeData.elements.OfType<NodeAnchorData>())
foreach (var anchor in nodeData.elements.OfType<AnchorDrawData>())
{
if (anchor.direction == Direction.Input)
inputsContainer.AddChild(new NodeAnchor(anchor));

31
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Manipulators/EdgeConnector.cs


var nodeAdapter = new NodeAdapter();
// get all available connectors
foreach (var toCnx in m_GraphView.allChildren.OfType<GraphElement>()
.Select(e => e.dataProvider)
.OfType<IConnector>()
.Where(c => c.IsConnectable() &&
c.orientation == cnx.orientation &&
c.direction != cnx.direction &&
nodeAdapter.GetAdapter(c.source, cnx.source) != null))
var one = m_GraphView.allChildren.OfType<GraphElement>().ToList();
var two = one.Select(e => e.dataProvider).ToList();
var three = two.OfType<IConnector>().ToList();
List<IConnector> connectors = new List<IConnector>();
foreach (var c in three)
{
if (!c.IsConnectable())
continue;
if (c.orientation != cnx.orientation)
continue;
if(c.direction == cnx.direction)
continue;
if(nodeAdapter.GetAdapter(c.source, cnx.source) == null)
continue;
connectors.Add(c);
}
foreach (var toCnx in connectors)
{
toCnx.highlight = true;
m_CompatibleAnchors.Add(toCnx);

}
m_CompatibleAnchors.Clear();
m_DataSource.RemoveElement(m_EdgeDataCandidate);
m_DataSource.RemoveTempElement(m_EdgeDataCandidate);
if (m_EdgeDataCandidate != null && m_DataSource != null && endConnector != null)
{

1
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/SerializableGraphView.cs


using System.Collections.Generic;
using System.Linq;
using RMGUI.GraphView;
using RMGUI.GraphView.Demo;
using UnityEngine;
using UnityEngine.RMGUI;

257
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Styles/SerializableGraph.uss.imported.asset


m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 11997, guid: 0000000000000000e000000000000000, type: 0}
m_Name: SerializableGraph.uss.imported
m_Name:
matchers: []
rules: []
floats: []
ints:
matchers:
- specificity: 2
selectorValues:
- NodeDrawer
selectorTypes: 02000000
ruleIndex: 0
depth: 2147483647
previousIndex: -1
nextIndex: -1
- specificity: 102
selectorValues:
- NodeDrawer
selectorTypes: 02000000
ruleIndex: 1
depth: 2147483647
previousIndex: -1
nextIndex: 2
- specificity: 102
selectorValues:
- slots
selectorTypes: 06000000
ruleIndex: 1
depth: 2147483647
previousIndex: 1
nextIndex: -1
- specificity: 202
selectorValues:
- NodeDrawer
selectorTypes: 02000000
ruleIndex: 2
depth: 2147483647
previousIndex: -1
nextIndex: 4
- specificity: 202
selectorValues:
- slots
selectorTypes: 06000000
ruleIndex: 2
depth: 2147483647
previousIndex: 3
nextIndex: 5
- specificity: 202
selectorValues:
- input
selectorTypes: 06000000
ruleIndex: 2
depth: 2147483647
previousIndex: 4
nextIndex: -1
- specificity: 202
selectorValues:
- NodeDrawer
selectorTypes: 02000000
ruleIndex: 3
depth: 2147483647
previousIndex: -1
nextIndex: 7
- specificity: 202
selectorValues:
- slots
selectorTypes: 06000000
ruleIndex: 3
depth: 2147483647
previousIndex: 6
nextIndex: 8
- specificity: 202
selectorValues:
- output
selectorTypes: 06000000
ruleIndex: 3
depth: 2147483647
previousIndex: 7
nextIndex: -1
- specificity: 102
selectorValues:
- NodeDrawer
selectorTypes: 02000000
ruleIndex: 4
depth: 2147483647
previousIndex: -1
nextIndex: 10
- specificity: 102
selectorValues:
- controls
selectorTypes: 06000000
ruleIndex: 4
depth: 2147483647
previousIndex: 9
nextIndex: -1
- specificity: 202
selectorValues:
- NodeDrawer
selectorTypes: 02000000
ruleIndex: 5
depth: 2147483647
previousIndex: -1
nextIndex: 12
- specificity: 202
selectorValues:
- controls
selectorTypes: 06000000
ruleIndex: 5
depth: 2147483647
previousIndex: 11
nextIndex: 13
- specificity: 202
selectorValues:
- element
selectorTypes: 06000000
ruleIndex: 5
depth: 2147483647
previousIndex: 12
nextIndex: -1
- specificity: 2
selectorValues:
- NodeDrawer
selectorTypes: 02000000
ruleIndex: 6
depth: 2147483647
previousIndex: -1
nextIndex: -1
- specificity: 102
selectorValues:
- NodeDrawer
selectorTypes: 02000000
ruleIndex: 7
depth: 2147483647
previousIndex: -1
nextIndex: 16
- specificity: 102
selectorValues:
- preview
selectorTypes: 06000000
ruleIndex: 7
depth: 2147483647
previousIndex: 15
nextIndex: -1
- specificity: 202
selectorValues:
- NodeDrawer
selectorTypes: 02000000
ruleIndex: 8
depth: 2147483647
previousIndex: -1
nextIndex: 18
- specificity: 202
selectorValues:
- preview
selectorTypes: 06000000
ruleIndex: 8
depth: 2147483647
previousIndex: 17
nextIndex: 19
- specificity: 202
selectorValues:
- image
selectorTypes: 06000000
ruleIndex: 8
depth: 2147483647
previousIndex: 18
nextIndex: -1
- specificity: 2
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 9
depth: 2147483647
previousIndex: -1
nextIndex: -1
rules:
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 0
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 1
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 23
valueIndex: 0
- type: 1
propertyID: 26
valueIndex: 2
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 23
valueIndex: 1
- type: 1
propertyID: 26
valueIndex: 3
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 4
- type: 0
propertyID: 7
valueIndex: 2
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 5
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 18
valueIndex: 3
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 6
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 18
valueIndex: 4
- type: 0
propertyID: 17
valueIndex: 5
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 18
valueIndex: 6
customPropertyNames: []
customPropertyHandles: []
floats:
- 1
- 1
- 2
- 26
- 200
- 200
- 26
ints: 00000000020000000000000000000000000000000000000000000000
bools:
colors: []
strings: []

4
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Styles/SerializableGraph.uss.imported.asset.meta


fileFormatVersion: 2
guid: 710b4b6fb4db58f47aeb6fec7fd76bb4
timeCreated: 1477986144
guid: 692fd89d176246745ad1640285f640d1
timeCreated: 1478070440
licenseType: Pro
NativeFormatImporter:
userData:

4
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Styles/SerializableGraph.uss.meta


fileFormatVersion: 2
guid: 2063531155c6d8f4db408f840d0daed9
timeCreated: 1476713791
guid: c040dbfc587a399438b3f4bf8cc95f4b
timeCreated: 1478070440
licenseType: Pro
StyleSheetImporter:
userData:

604
MaterialGraphProject/Assets/NewUI/Editor/Demo/Views/NodalView.uss.imported.asset


m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 11997, guid: 0000000000000000e000000000000000, type: 0}
m_Name: NodalView.uss.imported
m_Name:
matchers: []
rules: []
floats: []
ints:
matchers:
- specificity: 102
selectorValues:
- Node
selectorTypes: 02000000
ruleIndex: 0
depth: 2147483647
previousIndex: -1
nextIndex: 1
- specificity: 102
selectorValues:
- input
selectorTypes: 06000000
ruleIndex: 0
depth: 2147483647
previousIndex: 0
nextIndex: -1
- specificity: 102
selectorValues:
- Node
selectorTypes: 02000000
ruleIndex: 1
depth: 2147483647
previousIndex: -1
nextIndex: 3
- specificity: 102
selectorValues:
- output
selectorTypes: 06000000
ruleIndex: 1
depth: 2147483647
previousIndex: 2
nextIndex: -1
- specificity: 2
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 2
depth: 2147483647
previousIndex: -1
nextIndex: -1
- specificity: 102
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 3
depth: 2147483647
previousIndex: -1
nextIndex: 6
- specificity: 102
selectorValues:
- connector
selectorTypes: 06000000
ruleIndex: 3
depth: 2147483647
previousIndex: 5
nextIndex: -1
- specificity: 112
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 4
depth: 2147483647
previousIndex: -1
nextIndex: 8
- specificity: 112
selectorValues:
- connector
- anchorHighlight
selectorTypes: 0600000003000000
ruleIndex: 4
depth: 2147483647
previousIndex: 7
nextIndex: -1
- specificity: 102
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 5
depth: 2147483647
previousIndex: -1
nextIndex: 10
- specificity: 102
selectorValues:
- type
selectorTypes: 06000000
ruleIndex: 5
depth: 2147483647
previousIndex: 9
nextIndex: -1
- specificity: 213
selectorValues:
- Node
- horizontal
selectorTypes: 0200000003000000
ruleIndex: 6
depth: 2147483647
previousIndex: -1
nextIndex: 12
- specificity: 213
selectorValues:
- output
selectorTypes: 06000000
ruleIndex: 6
depth: 2147483647
previousIndex: 11
nextIndex: 13
- specificity: 213
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 6
depth: 2147483647
previousIndex: 12
nextIndex: 14
- specificity: 213
selectorValues:
- type
selectorTypes: 06000000
ruleIndex: 6
depth: 2147483647
previousIndex: 13
nextIndex: -1
- specificity: 113
selectorValues:
- Node
- horizontal
selectorTypes: 0200000003000000
ruleIndex: 7
depth: 2147483647
previousIndex: -1
nextIndex: 16
- specificity: 113
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 7
depth: 2147483647
previousIndex: 15
nextIndex: 17
- specificity: 113
selectorValues:
- connector
selectorTypes: 06000000
ruleIndex: 7
depth: 2147483647
previousIndex: 16
nextIndex: -1
- specificity: 12
selectorValues:
- Node
- horizontal
selectorTypes: 0200000003000000
ruleIndex: 8
depth: 2147483647
previousIndex: -1
nextIndex: -1
- specificity: 112
selectorValues:
- Node
- horizontal
selectorTypes: 0200000003000000
ruleIndex: 9
depth: 2147483647
previousIndex: -1
nextIndex: 20
- specificity: 112
selectorValues:
- input
selectorTypes: 06000000
ruleIndex: 9
depth: 2147483647
previousIndex: 19
nextIndex: -1
- specificity: 112
selectorValues:
- Node
- horizontal
selectorTypes: 0200000003000000
ruleIndex: 10
depth: 2147483647
previousIndex: -1
nextIndex: 22
- specificity: 112
selectorValues:
- output
selectorTypes: 06000000
ruleIndex: 10
depth: 2147483647
previousIndex: 21
nextIndex: -1
- specificity: 113
selectorValues:
- Node
- horizontal
selectorTypes: 0200000003000000
ruleIndex: 11
depth: 2147483647
previousIndex: -1
nextIndex: 24
- specificity: 113
selectorValues:
- input
selectorTypes: 06000000
ruleIndex: 11
depth: 2147483647
previousIndex: 23
nextIndex: 25
- specificity: 113
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 11
depth: 2147483647
previousIndex: 24
nextIndex: -1
- specificity: 113
selectorValues:
- Node
- horizontal
selectorTypes: 0200000003000000
ruleIndex: 12
depth: 2147483647
previousIndex: -1
nextIndex: 27
- specificity: 113
selectorValues:
- output
selectorTypes: 06000000
ruleIndex: 12
depth: 2147483647
previousIndex: 26
nextIndex: 28
- specificity: 113
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 12
depth: 2147483647
previousIndex: 27
nextIndex: -1
- specificity: 112
selectorValues:
- Node
- vertical
selectorTypes: 0200000003000000
ruleIndex: 13
depth: 2147483647
previousIndex: -1
nextIndex: 30
- specificity: 112
selectorValues:
- input
selectorTypes: 06000000
ruleIndex: 13
depth: 2147483647
previousIndex: 29
nextIndex: -1
- specificity: 112
selectorValues:
- Node
- vertical
selectorTypes: 0200000003000000
ruleIndex: 14
depth: 2147483647
previousIndex: -1
nextIndex: 32
- specificity: 112
selectorValues:
- output
selectorTypes: 06000000
ruleIndex: 14
depth: 2147483647
previousIndex: 31
nextIndex: -1
- specificity: 13
selectorValues:
- Node
- vertical
selectorTypes: 0200000003000000
ruleIndex: 15
depth: 2147483647
previousIndex: -1
nextIndex: 34
- specificity: 13
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 15
depth: 2147483647
previousIndex: 33
nextIndex: -1
- specificity: 113
selectorValues:
- Node
- vertical
selectorTypes: 0200000003000000
ruleIndex: 16
depth: 2147483647
previousIndex: -1
nextIndex: 36
- specificity: 113
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 16
depth: 2147483647
previousIndex: 35
nextIndex: 37
- specificity: 113
selectorValues:
- type
selectorTypes: 06000000
ruleIndex: 16
depth: 2147483647
previousIndex: 36
nextIndex: -1
- specificity: 113
selectorValues:
- Node
- vertical
selectorTypes: 0200000003000000
ruleIndex: 17
depth: 2147483647
previousIndex: -1
nextIndex: 39
- specificity: 113
selectorValues:
- input
selectorTypes: 06000000
ruleIndex: 17
depth: 2147483647
previousIndex: 38
nextIndex: 40
- specificity: 113
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 17
depth: 2147483647
previousIndex: 39
nextIndex: -1
- specificity: 113
selectorValues:
- Node
- vertical
selectorTypes: 0200000003000000
ruleIndex: 18
depth: 2147483647
previousIndex: -1
nextIndex: 42
- specificity: 113
selectorValues:
- output
selectorTypes: 06000000
ruleIndex: 18
depth: 2147483647
previousIndex: 41
nextIndex: 43
- specificity: 113
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 18
depth: 2147483647
previousIndex: 42
nextIndex: -1
- specificity: 12
selectorValues:
- Node
- vertical
selectorTypes: 0200000003000000
ruleIndex: 19
depth: 2147483647
previousIndex: -1
nextIndex: -1
- specificity: 2
selectorValues:
- NodesContentView
selectorTypes: 02000000
ruleIndex: 20
depth: 2147483647
previousIndex: -1
nextIndex: -1
rules:
- builtinPropertyHandles:
- type: 0
propertyID: 23
valueIndex: 0
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 23
valueIndex: 1
- type: 1
propertyID: 28
valueIndex: 0
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 1
valueIndex: 2
- type: 0
propertyID: 3
valueIndex: 3
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 3
propertyID: 41
valueIndex: 0
- type: 3
propertyID: 42
valueIndex: 1
- type: 0
propertyID: 24
valueIndex: 4
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 3
propertyID: 41
valueIndex: 2
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 3
propertyID: 40
valueIndex: 3
- type: 0
propertyID: 23
valueIndex: 5
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 32
valueIndex: 1
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 0
valueIndex: 6
- type: 0
propertyID: 2
valueIndex: 7
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 2
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 1
valueIndex: 8
- type: 3
propertyID: 41
valueIndex: 4
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 1
valueIndex: 9
- type: 3
propertyID: 41
valueIndex: 5
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 3
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 4
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 23
valueIndex: 10
- type: 1
propertyID: 26
valueIndex: 5
- type: 1
propertyID: 28
valueIndex: 6
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 23
valueIndex: 11
- type: 1
propertyID: 26
valueIndex: 7
- type: 1
propertyID: 28
valueIndex: 8
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 31
valueIndex: 9
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 32
valueIndex: 10
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 11
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 12
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 24
valueIndex: 12
- type: 3
propertyID: 42
valueIndex: 6
- type: 3
propertyID: 41
valueIndex: 7
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles: []
customPropertyNames:
- grid-background-color
- line-color
- thick-line-color
- spacing
- thick-lines
customPropertyHandles:
- type: 3
propertyID: 43
valueIndex: 8
- type: 3
propertyID: 43
valueIndex: 9
- type: 3
propertyID: 43
valueIndex: 10
- type: 1
propertyID: 43
valueIndex: 13
- type: 1
propertyID: 43
valueIndex: 14
floats:
- 1
- 1
- 5
- 5
- 4
- 1
- 5
- 5
- 15
- 15
- 1
- 1
- 1
ints: 020000000500000002000000020000000300000002000000010000000200000001000000020000000400000000000000010000004b0000000a000000
colors: []
colors:
- {r: 1, g: 1, b: 0, a: 1}
- {r: 1, g: 1, b: 0, a: 1}
- {r: 0, g: 0, b: 1, a: 1}
- {r: 1, g: 1, b: 1, a: 1}
- {r: 0.26666668, g: 0.26666668, b: 0.26666668, a: 1}
- {r: 0.26666668, g: 0.26666668, b: 0.26666668, a: 1}
- {r: 0.8, g: 0.8, b: 0.8, a: 1}
- {r: 0.39215687, g: 0.39215687, b: 0.39215687, a: 0.5019608}
- {r: 0.2509804, g: 0.2784314, b: 0.28627452, a: 1}
- {r: 0.1254902, g: 0.16078432, b: 0.24705882, a: 1}
- {r: 0.011764706, g: 0.047058824, b: 0.13333334, a: 1}
strings: []
assets: []

2
MaterialGraphProject/Assets/NewUI/Editor/Demo/Views/NodalView.uss.imported.asset.meta


fileFormatVersion: 2
guid: ae904e6b00e321143b960221024f7fc3
timeCreated: 1477985626
timeCreated: 1478070317
licenseType: Pro
NativeFormatImporter:
userData:

2
MaterialGraphProject/Assets/NewUI/Editor/Demo/Views/NodesContentView.cs


namespace RMGUI.GraphView.Demo
{
[StyleSheet("Assets/Editor/Demo/Views/NodalView.uss")]
[StyleSheet("Assets/NewUI/Editor/Demo/Views/NodalView.uss")]
class NodesContentView : SimpleContentView
{
private readonly System.Random rnd = new System.Random();

2
MaterialGraphProject/Assets/NewUI/Editor/Demo/Views/SimpleContentView.cs


namespace RMGUI.GraphView.Demo
{
[StyleSheet("Assets/Editor/Demo/Views/SimpleContentView.uss")]
[StyleSheet("Assets/NewUI/Editor/Demo/Views/SimpleContentView.uss")]
public class SimpleContentView : GraphView
{
public SimpleContentView()

246
MaterialGraphProject/Assets/NewUI/Editor/Demo/Views/SimpleContentView.uss.imported.asset


m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 11997, guid: 0000000000000000e000000000000000, type: 0}
m_Name: SimpleContentView.uss.imported
m_Name:
matchers: []
rules: []
floats: []
ints:
matchers:
- specificity: 2
selectorValues:
- WWWImage
selectorTypes: 02000000
ruleIndex: 0
depth: 2147483647
previousIndex: -1
nextIndex: 1
- specificity: 2
selectorValues:
- '*'
selectorTypes: 01000000
ruleIndex: 0
depth: 1
previousIndex: 0
nextIndex: -1
- specificity: 3
selectorValues:
- MiniMap
selectorTypes: 02000000
ruleIndex: 1
depth: 2147483647
previousIndex: -1
nextIndex: 3
- specificity: 3
selectorValues:
- Label
selectorTypes: 02000000
ruleIndex: 1
depth: 2147483647
previousIndex: 2
nextIndex: -1
- specificity: 12
selectorValues:
- MiniMap
- graphElement
selectorTypes: 0200000003000000
ruleIndex: 2
depth: 2147483647
previousIndex: -1
nextIndex: -1
- specificity: 3
selectorValues:
- MiniMap
selectorTypes: 02000000
ruleIndex: 3
depth: 2147483647
previousIndex: -1
nextIndex: 6
- specificity: 3
selectorValues:
- Label
selectorTypes: 02000000
ruleIndex: 3
depth: 2147483647
previousIndex: 5
nextIndex: -1
- specificity: 12
selectorValues:
- MiniMap
- anchored
selectorTypes: 0200000003000000
ruleIndex: 4
depth: 2147483647
previousIndex: -1
nextIndex: -1
- specificity: 13
selectorValues:
- MiniMap
- anchored
selectorTypes: 0200000003000000
ruleIndex: 5
depth: 2147483647
previousIndex: -1
nextIndex: 9
- specificity: 13
selectorValues:
- Label
selectorTypes: 02000000
ruleIndex: 5
depth: 2147483647
previousIndex: 8
nextIndex: -1
- specificity: 12
selectorValues:
- InvisibleBorderContainer
- graphElement
selectorTypes: 0200000003000000
ruleIndex: 6
depth: 2147483647
previousIndex: -1
nextIndex: -1
- specificity: 22
selectorValues:
- InvisibleBorderContainer
- graphElement
- selected
selectorTypes: 020000000300000003000000
ruleIndex: 7
depth: 2147483647
previousIndex: -1
nextIndex: -1
rules:
- builtinPropertyHandles:
- type: 0
propertyID: 1
valueIndex: 0
- type: 0
propertyID: 17
valueIndex: 1
- type: 0
propertyID: 18
valueIndex: 2
- type: 3
propertyID: 41
valueIndex: 0
- type: 0
propertyID: 25
valueIndex: 3
- type: 1
propertyID: 32
valueIndex: 0
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 12
valueIndex: 1
- type: 0
propertyID: 14
valueIndex: 4
- type: 0
propertyID: 13
valueIndex: 5
- type: 0
propertyID: 15
valueIndex: 6
- type: 0
propertyID: 18
valueIndex: 7
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 3
propertyID: 42
valueIndex: 1
- type: 3
propertyID: 41
valueIndex: 2
- type: 1
propertyID: 12
valueIndex: 2
- type: 0
propertyID: 5
valueIndex: 8
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 33
valueIndex: 3
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 13
valueIndex: 9
- type: 0
propertyID: 16
valueIndex: 10
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 3
propertyID: 40
valueIndex: 3
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 3
propertyID: 41
valueIndex: 4
- type: 3
propertyID: 42
valueIndex: 5
- type: 0
propertyID: 8
valueIndex: 11
- type: 0
propertyID: 9
valueIndex: 12
- type: 0
propertyID: 10
valueIndex: 13
- type: 0
propertyID: 11
valueIndex: 14
- type: 0
propertyID: 24
valueIndex: 15
- type: 0
propertyID: 25
valueIndex: 16
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 3
propertyID: 42
valueIndex: 6
customPropertyNames: []
customPropertyHandles: []
floats:
- 15
- 200
- 200
- 25
- 0
- 0
- 0
- 16
- 20
- 20
- 20
- 20
- 20
- 20
- 20
- 20
- 0
ints: 04000000010000000100000000000000
colors: []
colors:
- {r: 0.8, g: 0.8, b: 0.8, a: 1}
- {r: 0.8, g: 0.8, b: 0.8, a: 1}
- {r: 0.39215687, g: 0.39215687, b: 0.39215687, a: 0.5019608}
- {r: 0.6666667, g: 0.6666667, b: 0, a: 1}
- {r: 0, g: 1, b: 0, a: 1}
- {r: 0, g: 0, b: 0, a: 1}
- {r: 0, g: 0, b: 1, a: 1}
strings: []
assets: []

2
MaterialGraphProject/Assets/NewUI/Editor/Demo/Views/SimpleContentView.uss.imported.asset.meta


fileFormatVersion: 2
guid: fbe164d03ec59254eafe10baa5a9c5ba
timeCreated: 1477985626
timeCreated: 1478070327
licenseType: Pro
NativeFormatImporter:
userData:

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


namespace RMGUI.GraphView
{
[StyleSheet("Assets/Editor/Views/GraphView.uss")]
[StyleSheet("Assets/NewUI/Editor/Views/GraphView.uss")]
public abstract class GraphView : DataWatchContainer, ISelection
{
private IGraphElementDataSource m_DataSource;

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


.graphElement.selected {
border-color: #FF0;
}
}

74
MaterialGraphProject/Assets/NewUI/Editor/Views/GraphView.uss.imported.asset


m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 11997, guid: 0000000000000000e000000000000000, type: 0}
m_Name: GraphView.uss.imported
m_Name:
matchers: []
rules: []
floats: []
ints:
matchers:
- specificity: 11
selectorValues:
- graphElement
selectorTypes: 03000000
ruleIndex: 0
depth: 2147483647
previousIndex: -1
nextIndex: -1
- specificity: 21
selectorValues:
- graphElement
- selected
selectorTypes: 0300000003000000
ruleIndex: 1
depth: 2147483647
previousIndex: -1
nextIndex: -1
rules:
- builtinPropertyHandles:
- type: 1
propertyID: 32
valueIndex: 0
- type: 3
propertyID: 40
valueIndex: 0
- type: 0
propertyID: 8
valueIndex: 0
- type: 0
propertyID: 9
valueIndex: 1
- type: 0
propertyID: 10
valueIndex: 2
- type: 0
propertyID: 11
valueIndex: 3
- type: 0
propertyID: 24
valueIndex: 4
- type: 0
propertyID: 25
valueIndex: 5
- type: 3
propertyID: 41
valueIndex: 1
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 3
propertyID: 42
valueIndex: 2
customPropertyNames: []
customPropertyHandles: []
floats:
- 2
- 2
- 2
- 2
- 2
- 5
ints: 01000000
colors: []
colors:
- {r: 1, g: 1, b: 1, a: 1}
- {r: 0.2, g: 0.2, b: 0.2, a: 1}
- {r: 1, g: 1, b: 0, a: 1}
strings: []
assets: []

2
MaterialGraphProject/Assets/NewUI/Editor/Views/GraphView.uss.imported.asset.meta


fileFormatVersion: 2
guid: 1655c36f61ec5a5499f7dc1f3abea03c
timeCreated: 1477985626
timeCreated: 1478070258
licenseType: Pro
NativeFormatImporter:
userData:

1
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Drawer/MaterialNodeDrawer.cs


namespace UnityEditor.MaterialGraph.Drawing
{
[GUISkinStyle("window")]
public class MaterialNodeDrawer : NodeDrawer
{
VisualContainer m_PreviewContainer;

3
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphView.cs


using System.Linq;
using System.Reflection;
using RMGUI.GraphView;
using RMGUI.GraphView.Demo;
using UnityEditor.Graphing.Drawing;
using UnityEngine;
using UnityEngine.Graphing;

AddManipulator(new ContextualMenu(DoContextMenu));
dataMapper[typeof(MaterialNodeDrawData)] = typeof(MaterialNodeDrawer);
dataMapper[typeof(NodeAnchorData)] = typeof(NodeAnchor);
dataMapper[typeof(AnchorDrawData)] = typeof(NodeAnchor);
dataMapper[typeof(EdgeData)] = typeof(Edge);
var dictionary = new Dictionary<Event, ShortcutDelegate>();

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


MaterialNodeDrawer {
flex-direction: column;
}
width: 200;
flex:1;
MaterialNodeDrawer #slots #input {
MaterialNodeDrawer #slots #output {
justify-content: flex-end;
MaterialNodeDrawer #slots #output {
MaterialNodeDrawer #slots #input {
flex:1;
flex-direction: column;
}

padding-bottom: 2;
width: 200;
}
MaterialNodeDrawer {
height: 26;
}
MaterialNodeDrawer #preview {

}
NodeAnchor {
height: 26;
margin-top:5;
margin-bottom:5;
margin-right:5;
margin-left:5;
}
NodeAnchor #connector {
background-color:#FF0;
border-color:#FF0;
/* width is currently hard-coded */
border-width: 4;
}
NodeAnchor #connector.anchorHighlight {
background-color:#00F;
NodeAnchor #type {
text-color:#FFF;
flex:1;
}
MaterialNodeDrawer.horizontal #output NodeAnchor #type {
text-alignment:middle-right;
}
Node.horizontal NodeAnchor #connector {
margin-left: 5;
margin-right: 5;
}
MaterialNodeDrawer.horizontal {
flex-direction: row;
}
MaterialNodeDrawer.horizontal #input, MaterialNodeDrawer.horizontal #output {
margin-top: 15;
background-color:#444;
}
MaterialNodeDrawer.horizontal #input NodeAnchor {
flex-direction: row;
}
MaterialNodeDrawer.horizontal #output NodeAnchor {
flex-direction: row-reverse;
}

539
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Styles/MaterialGraph.uss.imported.asset


m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 11997, guid: 0000000000000000e000000000000000, type: 0}
m_Name: MaterialGraph.uss.imported
m_Name:
matchers: []
rules: []
floats: []
ints:
matchers:
- specificity: 102
selectorValues:
- MaterialNodeDrawer
selectorTypes: 02000000
ruleIndex: 0
depth: 2147483647
previousIndex: -1
nextIndex: 1
- specificity: 102
selectorValues:
- slots
selectorTypes: 06000000
ruleIndex: 0
depth: 2147483647
previousIndex: 0
nextIndex: -1
- specificity: 202
selectorValues:
- MaterialNodeDrawer
selectorTypes: 02000000
ruleIndex: 1
depth: 2147483647
previousIndex: -1
nextIndex: 3
- specificity: 202
selectorValues:
- slots
selectorTypes: 06000000
ruleIndex: 1
depth: 2147483647
previousIndex: 2
nextIndex: 4
- specificity: 202
selectorValues:
- output
selectorTypes: 06000000
ruleIndex: 1
depth: 2147483647
previousIndex: 3
nextIndex: -1
- specificity: 202
selectorValues:
- MaterialNodeDrawer
selectorTypes: 02000000
ruleIndex: 2
depth: 2147483647
previousIndex: -1
nextIndex: 6
- specificity: 202
selectorValues:
- slots
selectorTypes: 06000000
ruleIndex: 2
depth: 2147483647
previousIndex: 5
nextIndex: 7
- specificity: 202
selectorValues:
- input
selectorTypes: 06000000
ruleIndex: 2
depth: 2147483647
previousIndex: 6
nextIndex: -1
- specificity: 102
selectorValues:
- MaterialNodeDrawer
selectorTypes: 02000000
ruleIndex: 3
depth: 2147483647
previousIndex: -1
nextIndex: 9
- specificity: 102
selectorValues:
- controls
selectorTypes: 06000000
ruleIndex: 3
depth: 2147483647
previousIndex: 8
nextIndex: -1
- specificity: 202
selectorValues:
- MaterialNodeDrawer
selectorTypes: 02000000
ruleIndex: 4
depth: 2147483647
previousIndex: -1
nextIndex: 11
- specificity: 202
selectorValues:
- controls
selectorTypes: 06000000
ruleIndex: 4
depth: 2147483647
previousIndex: 10
nextIndex: 12
- specificity: 202
selectorValues:
- element
selectorTypes: 06000000
ruleIndex: 4
depth: 2147483647
previousIndex: 11
nextIndex: -1
- specificity: 102
selectorValues:
- MaterialNodeDrawer
selectorTypes: 02000000
ruleIndex: 5
depth: 2147483647
previousIndex: -1
nextIndex: 14
- specificity: 102
selectorValues:
- preview
selectorTypes: 06000000
ruleIndex: 5
depth: 2147483647
previousIndex: 13
nextIndex: -1
- specificity: 202
selectorValues:
- MaterialNodeDrawer
selectorTypes: 02000000
ruleIndex: 6
depth: 2147483647
previousIndex: -1
nextIndex: 16
- specificity: 202
selectorValues:
- preview
selectorTypes: 06000000
ruleIndex: 6
depth: 2147483647
previousIndex: 15
nextIndex: 17
- specificity: 202
selectorValues:
- image
selectorTypes: 06000000
ruleIndex: 6
depth: 2147483647
previousIndex: 16
nextIndex: -1
- specificity: 2
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 7
depth: 2147483647
previousIndex: -1
nextIndex: -1
- specificity: 102
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 8
depth: 2147483647
previousIndex: -1
nextIndex: 20
- specificity: 102
selectorValues:
- connector
selectorTypes: 06000000
ruleIndex: 8
depth: 2147483647
previousIndex: 19
nextIndex: -1
- specificity: 112
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 9
depth: 2147483647
previousIndex: -1
nextIndex: 22
- specificity: 112
selectorValues:
- connector
- anchorHighlight
selectorTypes: 0600000003000000
ruleIndex: 9
depth: 2147483647
previousIndex: 21
nextIndex: -1
- specificity: 102
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 10
depth: 2147483647
previousIndex: -1
nextIndex: 24
- specificity: 102
selectorValues:
- type
selectorTypes: 06000000
ruleIndex: 10
depth: 2147483647
previousIndex: 23
nextIndex: -1
- specificity: 213
selectorValues:
- MaterialNodeDrawer
- horizontal
selectorTypes: 0200000003000000
ruleIndex: 11
depth: 2147483647
previousIndex: -1
nextIndex: 26
- specificity: 213
selectorValues:
- output
selectorTypes: 06000000
ruleIndex: 11
depth: 2147483647
previousIndex: 25
nextIndex: 27
- specificity: 213
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 11
depth: 2147483647
previousIndex: 26
nextIndex: 28
- specificity: 213
selectorValues:
- type
selectorTypes: 06000000
ruleIndex: 11
depth: 2147483647
previousIndex: 27
nextIndex: -1
- specificity: 113
selectorValues:
- Node
- horizontal
selectorTypes: 0200000003000000
ruleIndex: 12
depth: 2147483647
previousIndex: -1
nextIndex: 30
- specificity: 113
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 12
depth: 2147483647
previousIndex: 29
nextIndex: 31
- specificity: 113
selectorValues:
- connector
selectorTypes: 06000000
ruleIndex: 12
depth: 2147483647
previousIndex: 30
nextIndex: -1
- specificity: 12
selectorValues:
- MaterialNodeDrawer
- horizontal
selectorTypes: 0200000003000000
ruleIndex: 13
depth: 2147483647
previousIndex: -1
nextIndex: -1
- specificity: 112
selectorValues:
- MaterialNodeDrawer
- horizontal
selectorTypes: 0200000003000000
ruleIndex: 14
depth: 2147483647
previousIndex: -1
nextIndex: 34
- specificity: 112
selectorValues:
- input
selectorTypes: 06000000
ruleIndex: 14
depth: 2147483647
previousIndex: 33
nextIndex: -1
- specificity: 112
selectorValues:
- MaterialNodeDrawer
- horizontal
selectorTypes: 0200000003000000
ruleIndex: 15
depth: 2147483647
previousIndex: -1
nextIndex: 36
- specificity: 112
selectorValues:
- output
selectorTypes: 06000000
ruleIndex: 15
depth: 2147483647
previousIndex: 35
nextIndex: -1
- specificity: 113
selectorValues:
- MaterialNodeDrawer
- horizontal
selectorTypes: 0200000003000000
ruleIndex: 16
depth: 2147483647
previousIndex: -1
nextIndex: 38
- specificity: 113
selectorValues:
- input
selectorTypes: 06000000
ruleIndex: 16
depth: 2147483647
previousIndex: 37
nextIndex: 39
- specificity: 113
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 16
depth: 2147483647
previousIndex: 38
nextIndex: -1
- specificity: 113
selectorValues:
- MaterialNodeDrawer
- horizontal
selectorTypes: 0200000003000000
ruleIndex: 17
depth: 2147483647
previousIndex: -1
nextIndex: 41
- specificity: 113
selectorValues:
- output
selectorTypes: 06000000
ruleIndex: 17
depth: 2147483647
previousIndex: 40
nextIndex: 42
- specificity: 113
selectorValues:
- NodeAnchor
selectorTypes: 02000000
ruleIndex: 17
depth: 2147483647
previousIndex: 41
nextIndex: -1
rules:
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 0
- type: 0
propertyID: 23
valueIndex: 0
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 23
valueIndex: 1
- type: 1
propertyID: 26
valueIndex: 1
- type: 1
propertyID: 28
valueIndex: 2
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 23
valueIndex: 2
- type: 1
propertyID: 26
valueIndex: 3
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 4
- type: 0
propertyID: 7
valueIndex: 3
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 5
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 6
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 18
valueIndex: 4
- type: 0
propertyID: 17
valueIndex: 5
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 1
valueIndex: 6
- type: 0
propertyID: 3
valueIndex: 7
- type: 0
propertyID: 2
valueIndex: 8
- type: 0
propertyID: 0
valueIndex: 9
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 3
propertyID: 41
valueIndex: 0
- type: 3
propertyID: 42
valueIndex: 1
- type: 0
propertyID: 24
valueIndex: 10
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 3
propertyID: 41
valueIndex: 2
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 3
propertyID: 40
valueIndex: 3
- type: 0
propertyID: 23
valueIndex: 11
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 32
valueIndex: 7
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 0
valueIndex: 12
- type: 0
propertyID: 2
valueIndex: 13
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 8
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 1
valueIndex: 14
- type: 3
propertyID: 41
valueIndex: 4
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 0
propertyID: 1
valueIndex: 15
- type: 3
propertyID: 41
valueIndex: 5
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 9
customPropertyNames: []
customPropertyHandles: []
- builtinPropertyHandles:
- type: 1
propertyID: 26
valueIndex: 10
customPropertyNames: []
customPropertyHandles: []
floats:
- 1
- 1
- 1
- 2
- 200
- 200
- 5
- 5
- 5
- 5
- 4
- 1
- 5
- 5
- 15
- 15
ints: 0200000000000000020000000000000000000000000000000000000005000000020000000200000003000000
colors: []
colors:
- {r: 1, g: 1, b: 0, a: 1}
- {r: 1, g: 1, b: 0, a: 1}
- {r: 0, g: 0, b: 1, a: 1}
- {r: 1, g: 1, b: 1, a: 1}
- {r: 0.26666668, g: 0.26666668, b: 0.26666668, a: 1}
- {r: 0.26666668, g: 0.26666668, b: 0.26666668, a: 1}
strings: []
assets: []

2
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Styles/MaterialGraph.uss.imported.asset.meta


fileFormatVersion: 2
guid: 13814e9314253674e8d4966bba14d963
timeCreated: 1477986144
timeCreated: 1478071405
licenseType: Pro
NativeFormatImporter:
userData:

6
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Styles/MaterialGraph.uss.meta


fileFormatVersion: 2
guid: 3d8d6d1aa1a125542a19bf0cf3963095
timeCreated: 1475574870
guid: 466e6b269ff1900438e46c66af51cef8
timeCreated: 1478070440
DefaultImporter:
StyleSheetImporter:
userData:
assetBundleName:
assetBundleVariant:

9
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/COPIED.meta


fileFormatVersion: 2
guid: ef89c3094f656ca419096cec59d816af
folderAsset: yes
timeCreated: 1478076357
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

218
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/COPIED/GridBackground.cs


using System;
using RMGUI.GraphView;
using UnityEngine;
using UnityEngine.RMGUI;
using UnityEngine.RMGUI.StyleSheets;
namespace UnityEditor.Graphing.Drawing
{
public class GridBackground : IDecorator, IStyleTarget
{
const string SpacingProperty = "spacing";
const string ThickLinesProperty = "thick-lines";
const string LineColorProperty = "line-color";
const string ThickLineColorProperty = "thick-line-color";
const string GridBackgroundColorProperty = "grid-background-color";
StyleProperty<float> m_Spacing;
float spacing
{
get
{
return m_Spacing.GetOrDefault(50.0f);
}
}
StyleProperty<int> m_ThickLines;
int thickLines
{
get
{
return m_ThickLines.GetOrDefault(10);
}
}
StyleProperty<Color> m_LineColor;
Color lineColor
{
get
{
return m_LineColor.GetOrDefault(new Color(0f, 0f, 0f, 0.18f));
}
}
StyleProperty<Color> m_ThickLineColor;
Color thickLineColor
{
get
{
return m_ThickLineColor.GetOrDefault(new Color(0f, 0f, 0f, 0.38f));
}
}
StyleProperty<Color> m_BackgroundColor;
Color backgroundColor
{
get
{
return m_BackgroundColor.GetOrDefault(new Color(0.17f, 0.17f, 0.17f, 1.0f));
}
}
private VisualContainer m_Container;
private Vector3 Clip(Rect clipRect, Vector3 _in)
{
if (_in.x < clipRect.xMin)
_in.x = clipRect.xMin;
if (_in.x > clipRect.xMax)
_in.x = clipRect.xMax;
if (_in.y < clipRect.yMin)
_in.y = clipRect.yMin;
if (_in.y > clipRect.yMax)
_in.y = clipRect.yMax;
return _in;
}
// Notes: styles are read from this manipulator's target,
// note its m_Container member
public void OnStylesResolved(VisualElementStyles styles)
{
styles.ApplyCustomProperty(SpacingProperty, ref m_Spacing);
styles.ApplyCustomProperty(ThickLinesProperty, ref m_ThickLines);
styles.ApplyCustomProperty(ThickLineColorProperty, ref m_ThickLineColor);
styles.ApplyCustomProperty(LineColorProperty, ref m_LineColor);
styles.ApplyCustomProperty(GridBackgroundColorProperty, ref m_BackgroundColor);
}
public void PrePaint(VisualElement target, IStylePainter pc)
{
var graphView = target as GraphView;
if (graphView == null)
{
throw new InvalidOperationException("GridBackground decorator can only be added to a GraphView");
}
m_Container = graphView.contentViewContainer;
Rect clientRect = graphView.position;
var containerScale = new Vector3(m_Container.transform.GetColumn(0).magnitude,
m_Container.transform.GetColumn(1).magnitude,
m_Container.transform.GetColumn(2).magnitude);
var containerTranslation = m_Container.transform.GetColumn(3);
var containerPosition = m_Container.position;
// background
UIHelpers.ApplyWireMaterial();
GL.Begin(GL.QUADS);
GL.Color(backgroundColor);
GL.Vertex(new Vector3(clientRect.x, clientRect.y));
GL.Vertex(new Vector3(clientRect.xMax, clientRect.y));
GL.Vertex(new Vector3(clientRect.xMax, clientRect.yMax));
GL.Vertex(new Vector3(clientRect.x, clientRect.yMax));
GL.End();
// vertical lines
Vector3 from = new Vector3(clientRect.x, clientRect.y, 0.0f);
Vector3 to = new Vector3(clientRect.x, clientRect.height, 0.0f);
var tx = Matrix4x4.TRS(containerTranslation, Quaternion.identity, Vector3.one);
from = tx.MultiplyPoint(from);
to = tx.MultiplyPoint(to);
from.x += (containerPosition.x * containerScale.x);
from.y += (containerPosition.y * containerScale.y);
to.x += (containerPosition.x * containerScale.x);
to.y += (containerPosition.y * containerScale.y);
Handles.DrawWireDisc(from, new Vector3(0.0f, 0.0f, -1.0f), 6f);
float thickGridLineX = from.x;
float thickGridLineY = from.y;
// Update from/to to start at beginning of clientRect
from.x = (from.x % (spacing * (containerScale.x)) - (spacing * (containerScale.x)));
to.x = from.x;
from.y = clientRect.y;
to.y = clientRect.y + clientRect.height;
while (from.x < clientRect.width)
{
from.x += spacing * containerScale.x;
to.x += spacing * containerScale.x;
GL.Begin(GL.LINES);
GL.Color(lineColor);
GL.Vertex(Clip(clientRect, from));
GL.Vertex(Clip(clientRect, to));
GL.End();
}
float thickLineSpacing = (spacing * thickLines);
from.x = to.x = (thickGridLineX % (thickLineSpacing * (containerScale.x)) - (thickLineSpacing * (containerScale.x)));
while (from.x < clientRect.width + thickLineSpacing)
{
GL.Begin(GL.LINES);
GL.Color(thickLineColor);
GL.Vertex(Clip(clientRect, from));
GL.Vertex(Clip(clientRect, to));
GL.End();
from.x += (spacing * containerScale.x * thickLines);
to.x += (spacing * containerScale.x * thickLines);
}
// horizontal lines
from = new Vector3(clientRect.x, clientRect.y, 0.0f);
to = new Vector3(clientRect.x + clientRect.width, clientRect.y, 0.0f);
from.x += (containerPosition.x * containerScale.x);
from.y += (containerPosition.y * containerScale.y);
to.x += (containerPosition.x * containerScale.x);
to.y += (containerPosition.y * containerScale.y);
from = tx.MultiplyPoint(from);
to = tx.MultiplyPoint(to);
from.y = to.y = (from.y % (spacing * (containerScale.y)) - (spacing * (containerScale.y)));
from.x = clientRect.x;
to.x = clientRect.width;
while (from.y < clientRect.height)
{
from.y += spacing * containerScale.y;
to.y += spacing * containerScale.y;
GL.Begin(GL.LINES);
GL.Color(lineColor);
GL.Vertex(Clip(clientRect, from));
GL.Vertex(Clip(clientRect, to));
GL.End();
}
thickLineSpacing = spacing * thickLines;
from.y = to.y = (thickGridLineY % (thickLineSpacing * (containerScale.y)) - (thickLineSpacing * (containerScale.y)));
while (from.y < clientRect.height + thickLineSpacing)
{
GL.Begin(GL.LINES);
GL.Color(thickLineColor);
GL.Vertex(Clip(clientRect, from));
GL.Vertex(Clip(clientRect, to));
GL.End();
from.y += spacing * containerScale.y * thickLines;
to.y += spacing * containerScale.y * thickLines;
}
}
public void PostPaint(VisualElement element, IStylePainter pc)
{
}
}
}

12
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/COPIED/GridBackground.cs.meta


fileFormatVersion: 2
guid: 8ad0c1aa896f15a49b31a4efedb73df7
timeCreated: 1478076357
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

104
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/COPIED/NodeAnchor.cs


using System;
using RMGUI.GraphView;
using UnityEngine;
using UnityEngine.RMGUI;
using UnityEngine.RMGUI.StyleSheets;
namespace UnityEditor.Graphing.Drawing
{
internal class NodeAnchor : GraphElement
{
public const float k_NodeSize = 15.0f;
private readonly EdgeConnector<EdgeData> m_RegularConnector = new EdgeConnector<EdgeData>();
private readonly EdgeConnector<EdgeData> m_CustomConnector = new EdgeConnector<EdgeData>();
private IManipulator m_CurrentConnector;
VisualElement m_ConnectorBox;
VisualElement m_ConnectorText;
public NodeAnchor(NodeAnchorData data)
{
// currently we don't want to be styled as .graphElement since we're contained in a Node
classList = ClassList.empty;
m_CurrentConnector = m_RegularConnector;
AddManipulator(m_CurrentConnector);
m_ConnectorBox = new VisualElement() { name = "connector", width = k_NodeSize, height = k_NodeSize };
m_ConnectorBox.pickingMode = PickingMode.Ignore;
AddChild(m_ConnectorBox);
m_ConnectorText = new VisualElement() { name = "type" };
m_ConnectorText.content = new GUIContent();
m_ConnectorText.pickingMode = PickingMode.Ignore;
AddChild(m_ConnectorText);
dataProvider = data;
}
private void UpdateConnector()
{
var nodeAnchorData = GetData<NodeAnchorData>();
if (nodeAnchorData == null)
return;
RemoveManipulator(m_CurrentConnector);
if (!nodeAnchorData.connected || nodeAnchorData.direction != Direction.Input)
{
if (nodeAnchorData.orientation == Orientation.Horizontal)
{
m_CurrentConnector = m_RegularConnector;
}
else
{
m_CurrentConnector = m_CustomConnector;
}
AddManipulator(m_CurrentConnector);
}
}
public override void OnDataChanged()
{
UpdateConnector();
var nodeAnchorData = GetData<NodeAnchorData>();
if (nodeAnchorData == null)
return;
Type type = nodeAnchorData.type;
Type genericClass = typeof(PortSource<>);
Type constructedClass = genericClass.MakeGenericType(type);
nodeAnchorData.source = Activator.CreateInstance(constructedClass);
if (nodeAnchorData.highlight)
{
m_ConnectorBox.AddToClassList("anchorHighlight");
}
else
{
m_ConnectorBox.RemoveFromClassList("anchorHighlight");
}
string anchorName = string.IsNullOrEmpty(nodeAnchorData.name) ? type.Name : nodeAnchorData.name;
m_ConnectorText.content.text = anchorName;
GetData<NodeAnchorData>().capabilities &= ~Capabilities.Selectable;
}
public override Vector3 GetGlobalCenter()
{
var center = m_ConnectorBox.position.center;
center = m_ConnectorBox.transform.MultiplyPoint3x4(center);
return this.LocalToGlobal(center);
}
public override bool ContainsPoint(Vector2 localPoint)
{
// Here local point comes without position offset...
localPoint -= position.position;
return m_ConnectorBox.ContainsPoint(m_ConnectorBox.transform.MultiplyPoint3x4(localPoint));
}
}
}

12
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/COPIED/NodeAnchor.cs.meta


fileFormatVersion: 2
guid: ef650f51b0d5b034ca3a7f461eddbbeb
timeCreated: 1478076237
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

131
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/COPIED/NodeAnchorData.cs


using System;
using System.Collections.Generic;
using System.Linq;
using RMGUI.GraphView;
using UnityEngine;
namespace UnityEditor.Graphing.Drawing
{
[Serializable]
public class NodeAnchorData : GraphElementData, IConnector
{
protected object m_Source;
public object source
{
get { return m_Source;}
set
{
if (m_Source == value) return;
m_Source = value;
}
}
[SerializeField]
private Direction m_Direction;
public virtual Direction direction
{
// TODO We should not be able to change direction of an existing anchor
get { return m_Direction; }
set { m_Direction = value; }
}
[SerializeField]
private Orientation m_Orientation;
public virtual Orientation orientation
{
get { return m_Orientation; } set { m_Orientation = value; }
}
[SerializeField]
private Type m_Type;
public virtual Type type
{
get { return m_Type; }
set { m_Type = value; }
}
[SerializeField]
private bool m_Highlight;
public virtual bool highlight
{
get { return m_Highlight; }
set { m_Highlight = value; }
}
public virtual bool connected
{
get
{
return (m_Direction == Direction.Output ? m_OutputConnections : m_InputConnections).Count != 0;
}
}
public virtual IEnumerable<IConnection> connections
{
get
{
return (m_Direction == Direction.Output ? m_OutputConnections : m_InputConnections).Cast<IConnection>();
}
}
// TODO we'll probably want to distinguish between InputAnchorData and OutputAnchorData so as to
// not burden ourselves with extra data we don't need.
[SerializeField]
private List<GraphElementData> m_InputConnections;
[SerializeField]
private List<GraphElementData> m_OutputConnections;
public void Connect(IConnection connection)
{
var ged = connection as GraphElementData;
if (connection != null && ged == null)
{
throw new ArgumentException("The value passed to NodeAnchorData.Connect is not a GraphElementData");
}
if (m_Direction == Direction.Input)
{
if (!m_InputConnections.Contains(ged))
{
m_InputConnections.Add(ged);
}
}
else
{
if (!m_OutputConnections.Contains(ged))
{
m_OutputConnections.Add(ged);
}
}
}
public void Disconnect(IConnection connection)
{
var ged = connection as GraphElementData;
if (connection != null && ged == null)
{
throw new ArgumentException("The value passed to NodeAnchorData.Disconnect is not a GraphElementData");
}
if (m_Direction == Direction.Input)
{
m_InputConnections.Remove(ged);
}
else
{
m_OutputConnections.Remove(ged);
}
}
protected new void OnEnable()
{
base.OnEnable();
m_Type = typeof(object);
m_OutputConnections = new List<GraphElementData>();
m_InputConnections = new List<GraphElementData>();
}
protected NodeAnchorData() {}
}
}

12
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/COPIED/NodeAnchorData.cs.meta


fileFormatVersion: 2
guid: 527c7f272431f364e80331ec89e32e8a
timeCreated: 1478076527
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存