浏览代码

Merge branch 'master' into inspector-preview-mesh

/main
GitHub 7 年前
当前提交
8e31e809
共有 52 个文件被更改,包括 834 次插入999 次删除
  1. 377
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Graphs/AbstractMaterialGraph.cs
  2. 128
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Graphs/MaterialSlot.cs
  3. 206
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/AbstractMaterialNode.cs
  4. 6
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphEditWindow.cs
  5. 15
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/SerializationTests.cs
  6. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/UnitTests/AbstractMaterialGraphTests.cs
  7. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/UnitTests/MaterialNodeTests.cs
  8. 175
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/UnitTests/SerializedGraphTests.cs
  9. 2
      MaterialGraphProject/Assets/UnityShaderEditor/package.json
  10. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation/GraphObject.cs
  11. 3
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Interfaces/Graph.meta
  12. 7
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/TestMaterialGraph.cs
  13. 3
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/TestMaterialGraph.cs.meta
  14. 7
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/TestNode.cs
  15. 3
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/TestNode.cs.meta
  16. 33
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/TestSlot.cs
  17. 3
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/TestSlot.cs.meta
  18. 11
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Interfaces/MaterialGraphChange.cs.meta
  19. 38
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Interfaces/MaterialGraphChange.cs
  20. 8
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph.meta
  21. 3
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Interfaces/Graph/GraphChange.cs.meta
  22. 46
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Interfaces/Graph/GraphChange.cs
  23. 12
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation/SerializableGraph.cs.meta
  24. 12
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation/SerializableNode.cs.meta
  25. 12
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation/SerializableSlot.cs.meta
  26. 134
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation/SerializableSlot.cs
  27. 360
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation/SerializableGraph.cs
  28. 219
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation/SerializableNode.cs
  29. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation.meta
  30. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Interfaces/Graph/IGraphAsset.cs.meta
  31. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Interfaces/Graph/IGraphAsset.cs
  32. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/ListPool.cs.meta
  33. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/Logging.cs.meta
  34. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/ObjectPool.cs.meta
  35. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/SerializationHelper.cs.meta
  36. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/PooledObject.cs.meta
  37. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/DictionaryPool.cs.meta
  38. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/QueuePool.cs.meta
  39. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/StackPool.cs.meta
  40. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/DictionaryPool.cs
  41. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/ListPool.cs
  42. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/Logging.cs
  43. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/ObjectPool.cs
  44. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/PooledObject.cs
  45. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/QueuePool.cs
  46. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/SerializationHelper.cs
  47. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/StackPool.cs
  48. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Interfaces/Graph
  49. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation
  50. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation/GraphObject.cs.meta
  51. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation/GraphObject.cs

377
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Graphs/AbstractMaterialGraph.cs


namespace UnityEditor.ShaderGraph
{
[Serializable]
public abstract class AbstractMaterialGraph : SerializableGraph, IGenerateProperties
public abstract class AbstractMaterialGraph : IGraph, ISerializationCallbackReceiver, IGenerateProperties
public IGraphObject owner { get; set; }
#region Property data
public IEnumerable<IShaderProperty> properties
{
get { return m_Properties; }
}
[SerializeField]
List<SerializationHelper.JSONSerializedElement> m_SerializedProperties = new List<SerializationHelper.JSONSerializedElement>();

public IEnumerable<IShaderProperty> addedProperties
{
get { return m_AddedProperties; }
}
public IEnumerable<Guid> removedProperties
{
get { return m_RemovedProperties; }
}
#endregion
#region Node data
[NonSerialized]
Dictionary<Guid, INode> m_Nodes = new Dictionary<Guid, INode>();
public IEnumerable<T> GetNodes<T>() where T : INode
{
return m_Nodes.Values.OfType<T>();
}
InspectorPreviewData m_PreviewData = new InspectorPreviewData();
List<SerializationHelper.JSONSerializedElement> m_SerializableNodes = new List<SerializationHelper.JSONSerializedElement>();
[NonSerialized]
List<INode> m_AddedNodes = new List<INode>();
public IEnumerable<INode> addedNodes
{
get { return m_AddedNodes; }
}
[NonSerialized]
List<INode> m_RemovedNodes = new List<INode>();
public IEnumerable<INode> removedNodes
{
get { return m_RemovedNodes; }
}
public InspectorPreviewData previewData
#endregion
#region Edge data
[NonSerialized]
List<IEdge> m_Edges = new List<IEdge>();
public IEnumerable<IEdge> edges
get { return m_PreviewData; }
set { m_PreviewData = value; }
get { return m_Edges; }
public IEnumerable<IShaderProperty> properties
[SerializeField]
List<SerializationHelper.JSONSerializedElement> m_SerializableEdges = new List<SerializationHelper.JSONSerializedElement>();
[NonSerialized]
Dictionary<Guid, List<IEdge>> m_NodeEdges = new Dictionary<Guid, List<IEdge>>();
[NonSerialized]
List<IEdge> m_AddedEdges = new List<IEdge>();
public IEnumerable<IEdge> addedEdges
get { return m_Properties; }
get { return m_AddedEdges; }
public IEnumerable<IShaderProperty> addedProperties
[NonSerialized]
List<IEdge> m_RemovedEdges = new List<IEdge>();
public IEnumerable<IEdge> removedEdges
get { return m_AddedProperties; }
get { return m_RemovedEdges; }
public IEnumerable<Guid> removedProperties
#endregion
[SerializeField]
InspectorPreviewData m_PreviewData = new InspectorPreviewData();
public InspectorPreviewData previewData
get { return m_RemovedProperties; }
get { return m_PreviewData; }
set { m_PreviewData = value; }
public override void ClearChanges()
public void ClearChanges()
base.ClearChanges();
m_AddedNodes.Clear();
m_RemovedNodes.Clear();
m_AddedEdges.Clear();
m_RemovedEdges.Clear();
public override void AddNode(INode node)
public virtual void AddNode(INode node)
base.AddNode(node);
AddNodeNoValidate(node);
ValidateGraph();
}
else
{

void AddNodeNoValidate(INode node)
{
m_Nodes.Add(node.guid, node);
node.owner = this;
m_AddedNodes.Add(node);
}
public void RemoveNode(INode node)
{
if (!node.canDeleteNode)
return;
m_Nodes.Remove(node.guid);
m_RemovedNodes.Add(node);
ValidateGraph();
}
void RemoveNodeNoValidate(INode node)
{
if (!node.canDeleteNode)
return;
m_Nodes.Remove(node.guid);
m_RemovedNodes.Add(node);
}
void AddEdgeToNodeEdges(IEdge edge)
{
List<IEdge> inputEdges;
if (!m_NodeEdges.TryGetValue(edge.inputSlot.nodeGuid, out inputEdges))
m_NodeEdges[edge.inputSlot.nodeGuid] = inputEdges = new List<IEdge>();
inputEdges.Add(edge);
List<IEdge> outputEdges;
if (!m_NodeEdges.TryGetValue(edge.outputSlot.nodeGuid, out outputEdges))
m_NodeEdges[edge.outputSlot.nodeGuid] = outputEdges = new List<IEdge>();
outputEdges.Add(edge);
}
IEdge ConnectNoValidate(SlotReference fromSlotRef, SlotReference toSlotRef)
{
var fromNode = GetNodeFromGuid(fromSlotRef.nodeGuid);
var toNode = GetNodeFromGuid(toSlotRef.nodeGuid);
if (fromNode == null || toNode == null)
return null;
// if fromNode is already connected to toNode
// do now allow a connection as toNode will then
// have an edge to fromNode creating a cycle.
// if this is parsed it will lead to an infinite loop.
var dependentNodes = new List<INode>();
NodeUtils.CollectNodesNodeFeedsInto(dependentNodes, toNode);
if (dependentNodes.Contains(fromNode))
return null;
var fromSlot = fromNode.FindSlot<ISlot>(fromSlotRef.slotId);
var toSlot = toNode.FindSlot<ISlot>(toSlotRef.slotId);
if (fromSlot.isOutputSlot == toSlot.isOutputSlot)
return null;
var outputSlot = fromSlot.isOutputSlot ? fromSlotRef : toSlotRef;
var inputSlot = fromSlot.isInputSlot ? fromSlotRef : toSlotRef;
s_TempEdges.Clear();
GetEdges(inputSlot, s_TempEdges);
// remove any inputs that exits before adding
foreach (var edge in s_TempEdges)
{
RemoveEdgeNoValidate(edge);
}
var newEdge = new Edge(outputSlot, inputSlot);
m_Edges.Add(newEdge);
m_AddedEdges.Add(newEdge);
AddEdgeToNodeEdges(newEdge);
//Debug.LogFormat("Connected edge: {0} -> {1} ({2} -> {3})\n{4}", newEdge.outputSlot.nodeGuid, newEdge.inputSlot.nodeGuid, fromNode.name, toNode.name, Environment.StackTrace);
return newEdge;
}
public virtual IEdge Connect(SlotReference fromSlotRef, SlotReference toSlotRef)
{
var newEdge = ConnectNoValidate(fromSlotRef, toSlotRef);
ValidateGraph();
return newEdge;
}
public virtual void RemoveEdge(IEdge e)
{
RemoveEdgeNoValidate(e);
ValidateGraph();
}
public void RemoveElements(IEnumerable<INode> nodes, IEnumerable<IEdge> edges)
{
foreach (var edge in edges.ToArray())
RemoveEdgeNoValidate(edge);
foreach (var serializableNode in nodes.ToArray())
RemoveNodeNoValidate(serializableNode);
ValidateGraph();
}
protected void RemoveEdgeNoValidate(IEdge e)
{
e = m_Edges.FirstOrDefault(x => x.Equals(e));
if (e == null)
throw new ArgumentException("Trying to remove an edge that does not exist.", "e");
m_Edges.Remove(e);
List<IEdge> inputNodeEdges;
if (m_NodeEdges.TryGetValue(e.inputSlot.nodeGuid, out inputNodeEdges))
inputNodeEdges.Remove(e);
List<IEdge> outputNodeEdges;
if (m_NodeEdges.TryGetValue(e.outputSlot.nodeGuid, out outputNodeEdges))
outputNodeEdges.Remove(e);
m_RemovedEdges.Add(e);
}
public INode GetNodeFromGuid(Guid guid)
{
INode node;
m_Nodes.TryGetValue(guid, out node);
return node;
}
public bool ContainsNodeGuid(Guid guid)
{
return m_Nodes.ContainsKey(guid);
}
public T GetNodeFromGuid<T>(Guid guid) where T : INode
{
var node = GetNodeFromGuid(guid);
if (node is T)
return (T)node;
return default(T);
}
public void GetEdges(SlotReference s, List<IEdge> foundEdges)
{
var node = GetNodeFromGuid(s.nodeGuid);
if (node == null)
{
Debug.LogWarning("Node does not exist");
return;
}
ISlot slot = node.FindSlot<ISlot>(s.slotId);
List<IEdge> candidateEdges;
if (!m_NodeEdges.TryGetValue(s.nodeGuid, out candidateEdges))
return;
foreach (var edge in candidateEdges)
{
var cs = slot.isInputSlot ? edge.inputSlot : edge.outputSlot;
if (cs.nodeGuid == s.nodeGuid && cs.slotId == s.slotId)
foundEdges.Add(edge);
}
}
public virtual void CollectShaderProperties(PropertyCollector collector, GenerationMode generationMode)
{
foreach (var prop in properties)

}
}
public override void ValidateGraph()
public void ValidateGraph()
base.ValidateGraph();
//First validate edges, remove any
//orphans. This can happen if a user
//manually modifies serialized data
//of if they delete a node in the inspector
//debug view.
foreach (var edge in edges.ToArray())
{
var outputNode = GetNodeFromGuid(edge.outputSlot.nodeGuid);
var inputNode = GetNodeFromGuid(edge.inputSlot.nodeGuid);
if (outputNode == null
|| inputNode == null
|| outputNode.FindOutputSlot<ISlot>(edge.outputSlot.slotId) == null
|| inputNode.FindInputSlot<ISlot>(edge.inputSlot.slotId) == null)
{
//orphaned edge
RemoveEdgeNoValidate(edge);
}
}
foreach (var node in GetNodes<INode>())
node.ValidateNode();
foreach (var edge in m_AddedEdges.ToList())
{
if (!ContainsNodeGuid(edge.outputSlot.nodeGuid) || !ContainsNodeGuid(edge.inputSlot.nodeGuid))
{
Debug.LogWarningFormat("Added edge is invalid: {0} -> {1}\n{2}", edge.outputSlot.nodeGuid, edge.inputSlot.nodeGuid, Environment.StackTrace);
m_AddedEdges.Remove(edge);
}
}
public override Dictionary<SerializationHelper.TypeSerializationInfo, SerializationHelper.TypeSerializationInfo> GetLegacyTypeRemapping()
public Dictionary<SerializationHelper.TypeSerializationInfo, SerializationHelper.TypeSerializationInfo> GetLegacyTypeRemapping()
var result = base.GetLegacyTypeRemapping();
var result = new Dictionary<SerializationHelper.TypeSerializationInfo, SerializationHelper.TypeSerializationInfo>();
var viewNode = new SerializationHelper.TypeSerializationInfo
{
fullName = "UnityEngine.MaterialGraph.ViewDirectionNode"

return result;
}
public override void ReplaceWith(IGraph other)
public void ReplaceWith(IGraph other)
{
var otherMG = other as AbstractMaterialGraph;
if (otherMG != null)

AddShaderProperty(otherProperty);
}
}
base.ReplaceWith(other);
other.ValidateGraph();
ValidateGraph();
// Current tactic is to remove all nodes and edges and then re-add them, such that depending systems
// will re-initialize with new references.
using (var pooledList = ListPool<IEdge>.GetDisposable())
{
var removedNodeEdges = pooledList.value;
removedNodeEdges.AddRange(m_Edges);
foreach (var edge in removedNodeEdges)
RemoveEdgeNoValidate(edge);
}
using (var removedNodesPooledObject = ListPool<Guid>.GetDisposable())
{
var removedNodeGuids = removedNodesPooledObject.value;
removedNodeGuids.AddRange(m_Nodes.Keys);
foreach (var nodeGuid in removedNodeGuids)
RemoveNodeNoValidate(m_Nodes[nodeGuid]);
}
ValidateGraph();
foreach (var node in other.GetNodes<INode>())
AddNodeNoValidate(node);
foreach (var edge in other.edges)
ConnectNoValidate(edge.outputSlot, edge.inputSlot);
ValidateGraph();
public override void OnBeforeSerialize()
public void OnBeforeSerialize()
base.OnBeforeSerialize();
m_SerializableNodes = SerializationHelper.Serialize<INode>(m_Nodes.Values);
m_SerializableEdges = SerializationHelper.Serialize<IEdge>(m_Edges);
public override void OnAfterDeserialize()
public virtual void OnAfterDeserialize()
base.OnAfterDeserialize();
var nodes = SerializationHelper.Deserialize<INode>(m_SerializableNodes, GetLegacyTypeRemapping());
m_Nodes = new Dictionary<Guid, INode>(nodes.Count);
foreach (var node in nodes)
{
node.owner = this;
node.UpdateNodeAfterDeserialization();
m_Nodes.Add(node.guid, node);
}
m_SerializableNodes = null;
m_Edges = SerializationHelper.Deserialize<IEdge>(m_SerializableEdges, null);
m_SerializableEdges = null;
foreach (var edge in m_Edges)
AddEdgeToNodeEdges(edge);
}
internal static ShaderGraphRequirements GetRequirements(List<INode> nodes)

configuredTextures = shaderProperties.GetConfiguredTexutres();
return finalShader.GetShaderString(0);
}
}
public void OnEnable()
{
foreach (var node in GetNodes<INode>().OfType<IOnAssetEnabled>())
{
node.OnEnable();
}
}
}
[Serializable]
public class InspectorPreviewData
{

128
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Graphs/MaterialSlot.cs


using System;
using System.Linq;
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("com.unity.shadergraph.EditorTests")]
public abstract class MaterialSlot : SerializableSlot
public abstract class MaterialSlot : ISlot
const string k_NotInit = "Not Initilaized";
[SerializeField]
int m_Id;
[SerializeField]
string m_DisplayName = k_NotInit;
[SerializeField]
SlotType m_SlotType = SlotType.Input;
[SerializeField]
int m_Priority = int.MaxValue;
[SerializeField]
bool m_Hidden;
[SerializeField]
string m_ShaderOutputName;

private bool m_HasError;
bool m_HasError;
: base(slotId, displayName, slotType, hidden)
m_Id = slotId;
m_DisplayName = displayName;
m_SlotType = slotType;
m_Hidden = hidden;
m_ShaderOutputName = shaderOutputName;
this.shaderStage = shaderStage;
}
protected MaterialSlot(int slotId, string displayName, string shaderOutputName, SlotType slotType, int priority, ShaderStage shaderStage = ShaderStage.Dynamic, bool hidden = false)
{
m_Id = slotId;
m_DisplayName = displayName;
m_SlotType = slotType;
m_Priority = priority;
m_Hidden = hidden;
m_ShaderOutputName = shaderOutputName;
this.shaderStage = shaderStage;
}

}
}
public override string displayName
public virtual string displayName
get { return base.displayName + ConcreteSlotValueTypeAsString(concreteValueType); }
set { base.displayName = value; }
get { return m_DisplayName + ConcreteSlotValueTypeAsString(concreteValueType); }
set { m_DisplayName = value; }
return base.displayName;
return m_DisplayName;
}
public static MaterialSlot CreateMaterialSlot(SlotValueType type, int slotId, string displayName, string shaderOutputName, SlotType slotType, Vector4 defaultValue, ShaderStage shaderStage = ShaderStage.Dynamic, bool hidden = false)

throw new ArgumentOutOfRangeException("type", type, null);
}
public SlotReference slotReference
{
get { return new SlotReference(owner.guid, m_Id); }
}
public INode owner { get; set; }
public bool hidden
{
get { return m_Hidden; }
set { m_Hidden = value; }
}
public int id
{
get { return m_Id; }
}
public int priority
{
get { return m_Priority; }
set { m_Priority = value; }
}
public bool isInputSlot
{
get { return m_SlotType == SlotType.Input; }
}
public bool isOutputSlot
{
get { return m_SlotType == SlotType.Output; }
}
public SlotType slotType
{
get { return m_SlotType; }
}
public bool isConnected
{
get
{
// node and graph respectivly
if (owner == null || owner.owner == null)
return false;
var graph = owner.owner;
var edges = graph.GetEdges(slotReference);
return edges.Any();
}
}
public abstract SlotValueType valueType { get; }
public abstract ConcreteSlotValueType concreteValueType { get; }

}
public abstract void CopyValuesFrom(MaterialSlot foundSlot);
bool Equals(MaterialSlot other)
{
return m_Id == other.m_Id && owner.guid.Equals(other.owner.guid);
}
public bool Equals(ISlot other)
{
return Equals(other as object);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((MaterialSlot)obj);
}
public override int GetHashCode()
{
unchecked
{
return (m_Id * 397) ^ (owner != null ? owner.GetHashCode() : 0);
}
}
}
}

206
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/AbstractMaterialNode.cs


}
[Serializable]
public abstract class AbstractMaterialNode : SerializableNode, IGenerateProperties
public abstract class AbstractMaterialNode : INode, ISerializationCallbackReceiver, IGenerateProperties
{
protected static List<MaterialSlot> s_TempSlots = new List<MaterialSlot>();
protected static List<IEdge> s_TempEdges = new List<IEdge>();

}
[NonSerialized]
private Guid m_Guid;
[SerializeField]
private string m_GuidSerialized;
[SerializeField]
private string m_Name;
[SerializeField]
private DrawState m_DrawState;
[NonSerialized]
private List<ISlot> m_Slots = new List<ISlot>();
[SerializeField]
List<SerializationHelper.JSONSerializedElement> m_SerializableSlots = new List<SerializationHelper.JSONSerializedElement>();
[NonSerialized]
public IGraph owner { get; set; }
public OnNodeModified onModified { get; set; }
public Guid guid
{
get { return m_Guid; }
}
public string name
{
get { return m_Name; }
set { m_Name = value; }
}
public virtual bool canDeleteNode
{
get { return true; }
}
public DrawState drawState
{
get { return m_DrawState; }
set
{
m_DrawState = value;
if (onModified != null)
onModified(this, ModificationScope.Node);
}
}
private OutputPrecision m_OutputPrecision = OutputPrecision.@float;
//[SerializeField]
private OutputPrecision m_OutputPrecision = OutputPrecision.@float;
[SerializeField]
bool m_PreviewExpanded = true;

get { return true; }
}
public override bool hasError
public virtual bool hasError
{
get { return m_HasError; }
protected set { m_HasError = value; }

protected AbstractMaterialNode()
{
m_DrawState.expanded = true;
m_Guid = Guid.NewGuid();
public Guid RewriteGuid()
{
m_Guid = Guid.NewGuid();
return m_Guid;
}
public void GetInputSlots<T>(List<T> foundSlots) where T : ISlot
{
foreach (var slot in m_Slots)
{
if (slot.isInputSlot && slot is T)
foundSlots.Add((T)slot);
}
}
public void GetOutputSlots<T>(List<T> foundSlots) where T : ISlot
{
foreach (var slot in m_Slots)
{
if (slot.isOutputSlot && slot is T)
foundSlots.Add((T)slot);
}
}
public void GetSlots<T>(List<T> foundSlots) where T : ISlot
{
foreach (var slot in m_Slots)
{
if (slot is T)
foundSlots.Add((T)slot);
}
}
public virtual void CollectShaderProperties(PropertyCollector properties, GenerationMode generationMode)
{
foreach (var inputSlot in this.GetInputSlots<MaterialSlot>())

return ConcreteSlotValueType.Vector1;
}
public override void ValidateNode()
public virtual void ValidateNode()
{
var isInError = false;

return new string(arr);
}
public sealed override void AddSlot(ISlot slot)
public void AddSlot(ISlot slot)
{
if (!(slot is MaterialSlot))
throw new ArgumentException(string.Format("Trying to add slot {0} to Material node {1}, but it is not a {2}", slot, this, typeof(MaterialSlot)));

// this will remove the old slot and add a new one
// if an old one was found. This allows updating values
base.AddSlot(slot);
m_Slots.RemoveAll(x => x.id == slot.id);
m_Slots.Add(slot);
slot.owner = this;
if (onModified != null)
{
onModified(this, ModificationScope.Topological);
}
if (foundSlot == null)
return;

public void RemoveSlot(int slotId)
{
// Remove edges that use this slot
// no owner can happen after creation
// but before added to graph
if (owner != null)
{
var edges = owner.GetEdges(GetSlotReference(slotId));
foreach (var edge in edges.ToArray())
owner.RemoveEdge(edge);
}
//remove slots
m_Slots.RemoveAll(x => x.id == slotId);
if (onModified != null)
{
onModified(this, ModificationScope.Topological);
}
}
public void RemoveSlotsNameNotMatching(IEnumerable<int> slotIds, bool supressWarnings = false)
{
var invalidSlots = m_Slots.Select(x => x.id).Except(slotIds);
foreach (var invalidSlot in invalidSlots.ToArray())
{
if (!supressWarnings)
Debug.LogWarningFormat("Removing Invalid MaterialSlot: {0}", invalidSlot);
RemoveSlot(invalidSlot);
}
}
public SlotReference GetSlotReference(int slotId)
{
var slot = FindSlot<ISlot>(slotId);
if (slot == null)
throw new ArgumentException("Slot could not be found", "slotId");
return new SlotReference(guid, slotId);
}
public T FindSlot<T>(int slotId) where T : ISlot
{
foreach (var slot in m_Slots)
{
if (slot.id == slotId && slot is T)
return (T)slot;
}
return default(T);
}
public T FindInputSlot<T>(int slotId) where T : ISlot
{
foreach (var slot in m_Slots)
{
if (slot.isInputSlot && slot.id == slotId && slot is T)
return (T)slot;
}
return default(T);
}
public T FindOutputSlot<T>(int slotId) where T : ISlot
{
foreach (var slot in m_Slots)
{
if (slot.isOutputSlot && slot.id == slotId && slot is T)
return (T)slot;
}
return default(T);
}
public virtual IEnumerable<ISlot> GetInputsWithNoConnection()
{
return this.GetInputSlots<ISlot>().Where(x => !owner.GetEdges(GetSlotReference(x.id)).Any());
}
public virtual void OnBeforeSerialize()
{
m_GuidSerialized = m_Guid.ToString();
m_SerializableSlots = SerializationHelper.Serialize<ISlot>(m_Slots);
}
public virtual void OnAfterDeserialize()
{
if (!string.IsNullOrEmpty(m_GuidSerialized))
m_Guid = new Guid(m_GuidSerialized);
else
m_Guid = Guid.NewGuid();
m_Slots = SerializationHelper.Deserialize<ISlot>(m_SerializableSlots, null);
m_SerializableSlots = null;
foreach (var s in m_Slots)
s.owner = this;
UpdateNodeAfterDeserialization();
}
public virtual void UpdateNodeAfterDeserialization()
{}
}
}

6
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphEditWindow.cs


string m_Selected;
[SerializeField]
SerializableGraphObject m_GraphObject;
GraphObject m_GraphObject;
[NonSerialized]
bool m_HasError;

}
}
SerializableGraphObject graphObject
GraphObject graphObject
{
get { return m_GraphObject; }
set

selectedGuid = newSelectionGuid;
var textGraph = File.ReadAllText(path, Encoding.UTF8);
graphObject = CreateInstance<SerializableGraphObject>();
graphObject = CreateInstance<GraphObject>();
graphObject.hideFlags = HideFlags.HideAndDontSave;
graphObject.graph = JsonUtility.FromJson(textGraph, graphType) as IGraph;
graphObject.graph.OnEnable();

15
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/SerializationTests.cs


using NUnit.Framework;
using UnityEngine;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph;
namespace UnityEditor.Graphing.IntegrationTests
{

[Test]
public void TestSerializableSlotCanSerialize()
{
var toSerialize = new List<SerializableSlot>()
var toSerialize = new List<MaterialSlot>()
new SerializableSlot(0, "InSlot", SlotType.Input, 0),
new SerializableSlot(1, "OutSlot", SlotType.Output, 5),
new TestSlot(0, "InSlot", SlotType.Input, 0),
new TestSlot(1, "OutSlot", SlotType.Output, 5),
var serialized = SerializationHelper.Serialize<SerializableSlot>(toSerialize);
var loaded = SerializationHelper.Deserialize<SerializableSlot>(serialized, null);
var serialized = SerializationHelper.Serialize<MaterialSlot>(toSerialize);
var loaded = SerializationHelper.Deserialize<MaterialSlot>(serialized, null);
Assert.IsInstanceOf<SerializableSlot>(loaded[0]);
Assert.IsInstanceOf<SerializableSlot>(loaded[1]);
Assert.IsInstanceOf<MaterialSlot>(loaded[0]);
Assert.IsInstanceOf<MaterialSlot>(loaded[1]);
Assert.AreEqual(0, loaded[0].id);
Assert.AreEqual("InSlot", loaded[0].displayName);

4
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/UnitTests/AbstractMaterialGraphTests.cs


}
[Test]
public void TestCanNotAddSerializableNodeToMaterialGraph()
public void TestCanNotAddTestNodeToMaterialGraph()
var node = new SerializableNode();
var node = new TestNode();
graph.AddNode(node);
Assert.AreEqual(0, graph.edges.Count());
Assert.AreEqual(0, graph.GetNodes<AbstractMaterialNode>().Count());

2
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/UnitTests/MaterialNodeTests.cs


[Test]
public void AddingNonMaterialSlotToNodeThrows()
{
Assert.Throws<ArgumentException>(() => m_NodeA.AddSlot(new SerializableSlot(0, string.Empty, SlotType.Input)));
Assert.Throws<ArgumentException>(() => m_NodeA.AddSlot(new TestSlot(0, string.Empty, SlotType.Input)));
}
[Test]

175
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/UnitTests/SerializedGraphTests.cs


using NUnit.Framework;
using UnityEngine;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph;
public class SerializableGraphTests
public class BaseMaterialGraphTests
{
[OneTimeSetUp]
public void RunBeforeAnyTests()

[Test]
public void TestCanCreateSerializableGraph()
public void TestCanCreateBaseMaterialGraph()
var graph = new SerializableGraph();
var graph = new TestMaterialGraph();
Assert.AreEqual(0, graph.edges.Count());
Assert.AreEqual(0, graph.GetNodes<INode>().Count());

public void TestCanAddNodeToSerializableGraph()
public void TestCanAddNodeToBaseMaterialGraph()
var graph = new SerializableGraph();
var node = new SerializableNode();
var graph = new TestMaterialGraph();
var node = new TestNode();
node.name = "Test Node";
graph.AddNode(node);

}
[Test]
public void TestCanRemoveNodeFromSerializableGraph()
public void TestCanRemoveNodeFromBaseMaterialGraph()
var graph = new SerializableGraph();
var node = new SerializableNode();
var graph = new TestMaterialGraph();
var node = new TestNode();
node.name = "Test Node";
graph.AddNode(node);
Assert.AreEqual(1, graph.GetNodes<INode>().Count());

[Test]
public void TestCanModifyNodeDrawState()
{
var node = new SerializableNode();
var node = new TestNode();
node.name = "Test Node";
var drawState = node.drawState;

Assert.IsFalse(node.drawState.expanded);
}
private class SetErrorNode : SerializableNode
private class SetErrorNode : TestNode
{
public void SetError()
{

[Test]
public void TestNodeGUIDCanBeRewritten()
{
var node = new SerializableNode();
var node = new TestNode();
public class TestableNode : SerializableNode
public class TestableNode : TestNode
{
public const int Input0 = 0;
public const int Input1 = 1;

public TestableNode()
{
AddSlot(new SerializableSlot(Input0, "Input", SlotType.Input));
AddSlot(new SerializableSlot(Input1, "Input", SlotType.Input));
AddSlot(new SerializableSlot(Input2, "Input", SlotType.Input));
AddSlot(new TestSlot(Input0, "Input", SlotType.Input));
AddSlot(new TestSlot(Input1, "Input", SlotType.Input));
AddSlot(new TestSlot(Input2, "Input", SlotType.Input));
AddSlot(new SerializableSlot(Output0, "Output", SlotType.Output));
AddSlot(new SerializableSlot(Output1, "Output", SlotType.Output));
AddSlot(new SerializableSlot(Output2, "Output", SlotType.Output));
AddSlot(new TestSlot(Output0, "Output", SlotType.Output));
AddSlot(new TestSlot(Output1, "Output", SlotType.Output));
AddSlot(new TestSlot(Output2, "Output", SlotType.Output));
public void TestRemoveNodeFromSerializableGraphCleansEdges()
public void TestRemoveNodeFromBaseMaterialGraphCleansEdges()
var graph = new SerializableGraph();
var graph = new TestMaterialGraph();
var outputNode = new TestableNode();
graph.AddNode(outputNode);

Assert.AreEqual(inputNode, graph.GetNodes<INode>().FirstOrDefault());
}
private class NoDeleteNode : SerializableNode
private class NoDeleteNode : TestNode
public void TestCanNotRemoveNoDeleteNodeFromSerializableGraph()
public void TestCanNotRemoveNoDeleteNodeFromBaseMaterialGraph()
var graph = new SerializableGraph();
var graph = new TestMaterialGraph();
var node = new NoDeleteNode();
node.name = "Test Node";
graph.AddNode(node);

Assert.AreEqual(1, graph.GetNodes<INode>().Count());
}
private class OnEnableNode : SerializableNode, IOnAssetEnabled
private class OnEnableNode : TestNode, IOnAssetEnabled
{
public bool called = false;
public void OnEnable()

[Test]
public void TestSerializedGraphDelegatesOnEnableCalls()
{
var graph = new SerializableGraph();
var graph = new TestMaterialGraph();
var node = new OnEnableNode();
node.name = "Test Node";
graph.AddNode(node);

}
[Test]
public void TestCanFindNodeInSerializableGraph()
public void TestCanFindNodeInBaseMaterialGraph()
var graph = new SerializableGraph();
var node = new SerializableNode();
var graph = new TestMaterialGraph();
var node = new TestNode();
graph.AddNode(node);
Assert.AreEqual(1, graph.GetNodes<INode>().Count());

[Test]
public void TestCanAddSlotToSerializableNode()
public void TestCanAddSlotToTestNode()
var graph = new SerializableGraph();
var node = new SerializableNode();
node.AddSlot(new SerializableSlot(0, "output", SlotType.Output));
node.AddSlot(new SerializableSlot(1, "input", SlotType.Input));
var graph = new TestMaterialGraph();
var node = new TestNode();
node.AddSlot(new TestSlot(0, "output", SlotType.Output));
node.AddSlot(new TestSlot(1, "input", SlotType.Input));
node.name = "Test Node";
graph.AddNode(node);

}
[Test]
public void TestCanNotAddNullSlotToSerializableNode()
public void TestCanNotAddNullSlotToTestNode()
var node = new SerializableNode();
var node = new TestNode();
node.AddSlot(null);
node.name = "Test Node";
Assert.AreEqual(0, node.GetOutputSlots<ISlot>().Count());

public void TestCanRemoveSlotFromSerializableNode()
public void TestCanRemoveSlotFromTestNode()
var graph = new SerializableGraph();
var node = new SerializableNode();
node.AddSlot(new SerializableSlot(0, "output", SlotType.Output));
node.AddSlot(new SerializableSlot(1, "input", SlotType.Input));
var graph = new TestMaterialGraph();
var node = new TestNode();
node.AddSlot(new TestSlot(0, "output", SlotType.Output));
node.AddSlot(new TestSlot(1, "input", SlotType.Input));
graph.AddNode(node);
Assert.AreEqual(2, node.GetSlots<ISlot>().Count());

}
[Test]
public void TestCanRemoveSlotsWithNonMathingNameFromSerializableNode()
public void TestCanRemoveSlotsWithNonMathingNameFromTestNode()
var graph = new SerializableGraph();
var graph = new TestMaterialGraph();
var node = new TestableNode();
graph.AddNode(node);

}
[Test]
public void TestCanNotAddDuplicateSlotToSerializableNode()
public void TestCanNotAddDuplicateSlotToTestNode()
var graph = new SerializableGraph();
var node = new SerializableNode();
node.AddSlot(new SerializableSlot(0, "output", SlotType.Output));
node.AddSlot(new SerializableSlot(0, "output", SlotType.Output));
var graph = new TestMaterialGraph();
var node = new TestNode();
node.AddSlot(new TestSlot(0, "output", SlotType.Output));
node.AddSlot(new TestSlot(0, "output", SlotType.Output));
node.name = "Test Node";
graph.AddNode(node);

}
[Test]
public void TestCanUpdateDisplaynameByReaddingSlotToSerializableNode()
public void TestCanUpdateDisplaynameByReaddingSlotToTestNode()
var graph = new SerializableGraph();
var node = new SerializableNode();
node.AddSlot(new SerializableSlot(0, "output", SlotType.Output));
node.AddSlot(new SerializableSlot(0, "output_updated", SlotType.Output));
var graph = new TestMaterialGraph();
var node = new TestNode();
node.AddSlot(new TestSlot(0, "output", SlotType.Output));
node.AddSlot(new TestSlot(0, "output_updated", SlotType.Output));
node.name = "Test Node";
graph.AddNode(node);

[Test]
public void TestCanUpdateSlotPriority()
{
var graph = new SerializableGraph();
var node = new SerializableNode();
node.AddSlot(new SerializableSlot(0, "output", SlotType.Output, 0));
var graph = new TestMaterialGraph();
var node = new TestNode();
node.AddSlot(new TestSlot(0, "output", SlotType.Output, 0));
node.name = "Test Node";
graph.AddNode(node);

}
[Test]
public void TestCanUpdateSlotPriorityByReaddingSlotToSerializableNode()
public void TestCanUpdateSlotPriorityByReaddingSlotToTestNode()
var graph = new SerializableGraph();
var node = new SerializableNode();
node.AddSlot(new SerializableSlot(0, "output", SlotType.Output, 0));
node.AddSlot(new SerializableSlot(0, "output", SlotType.Output, 5));
var graph = new TestMaterialGraph();
var node = new TestNode();
node.AddSlot(new TestSlot(0, "output", SlotType.Output, 0));
node.AddSlot(new TestSlot(0, "output", SlotType.Output, 5));
node.name = "Test Node";
graph.AddNode(node);

[Test]
public void TestCanUpdateSlotDisplayName()
{
var node = new SerializableNode();
node.AddSlot(new SerializableSlot(0, "output", SlotType.Output));
var node = new TestNode();
node.AddSlot(new TestSlot(0, "output", SlotType.Output));
node.name = "Test Node";
Assert.AreEqual(0, node.GetInputSlots<ISlot>().Count());

}
[Test]
public void TestCanFindSlotOnSerializableNode()
public void TestCanFindSlotOnTestNode()
{
var node = new TestableNode();

}
[Test]
public void TestCanFindSlotReferenceOnSerializableNode()
public void TestCanFindSlotReferenceOnTestNode()
{
var node = new TestableNode();

}
[Test]
public void TestCanConnectAndTraverseTwoNodesOnSerializableGraph()
public void TestCanConnectAndTraverseTwoNodesOnBaseMaterialGraph()
var graph = new SerializableGraph();
var graph = new TestMaterialGraph();
var outputNode = new TestableNode();
graph.AddNode(outputNode);

}
[Test]
public void TestCanConnectAndTraverseThreeNodesOnSerializableGraph()
public void TestCanConnectAndTraverseThreeNodesOnBaseMaterialGraph()
var graph = new SerializableGraph();
var graph = new TestMaterialGraph();
var outputNode = new TestableNode();
graph.AddNode(outputNode);

[Test]
public void TestConectionToSameInputReplacesOldInput()
{
var graph = new SerializableGraph();
var graph = new TestMaterialGraph();
var outputNode = new TestableNode();
graph.AddNode(outputNode);

[Test]
public void TestRemovingSlotRemovesConnectedEdges()
{
var graph = new SerializableGraph();
var graph = new TestMaterialGraph();
var outputNode = new TestableNode();
graph.AddNode(outputNode);

[Test]
public void TestCanNotConnectToNullSlot()
{
var graph = new SerializableGraph();
var graph = new TestMaterialGraph();
var inputNode = new SerializableNode();
var inputNode = new TestNode();
graph.AddNode(inputNode);
Assert.AreEqual(2, graph.GetNodes<INode>().Count());

}
[Test]
public void TestCanNotConnectTwoOuputSlotsOnSerializableGraph()
public void TestCanNotConnectTwoOuputSlotsOnBaseMaterialGraph()
var graph = new SerializableGraph();
var graph = new TestMaterialGraph();
var outputNode = new TestableNode();
graph.AddNode(outputNode);

}
[Test]
public void TestCanNotConnectTwoInputSlotsOnSerializableGraph()
public void TestCanNotConnectTwoInputSlotsOnBaseMaterialGraph()
var graph = new SerializableGraph();
var graph = new TestMaterialGraph();
var inputNode = new TestableNode();
graph.AddNode(inputNode);

}
[Test]
public void TestRemovingNodeRemovesConectedEdgesOnSerializableGraph()
public void TestRemovingNodeRemovesConectedEdgesOnBaseMaterialGraph()
var graph = new SerializableGraph();
var graph = new TestMaterialGraph();
var outputNode = new TestableNode();
graph.AddNode(outputNode);

}
[Test]
public void TestRemovingEdgeOnSerializableGraph()
public void TestRemovingEdgeOnBaseMaterialGraph()
var graph = new SerializableGraph();
var graph = new TestMaterialGraph();
var outputNode = new TestableNode();
graph.AddNode(outputNode);

}
[Test]
public void TestRemovingElementsFromSerializableGraph()
public void TestRemovingElementsFromBaseMaterialGraph()
var graph = new SerializableGraph();
var graph = new TestMaterialGraph();
var outputNode = new TestableNode();
graph.AddNode(outputNode);

}
[Test]
public void TestCanGetEdgesOnSerializableGraphFromSlotReference()
public void TestCanGetEdgesOnBaseMaterialGraphFromSlotReference()
var graph = new SerializableGraph();
var graph = new TestMaterialGraph();
var outputNode = new TestableNode();
graph.AddNode(outputNode);

[Test]
public void TestGetInputsWithNoConnection()
{
var graph = new SerializableGraph();
var graph = new TestMaterialGraph();
var outputNode = new TestableNode();
graph.AddNode(outputNode);

[Test]
public void TestCyclicConnectionsAreNotAllowedOnGraph()
{
var graph = new SerializableGraph();
var graph = new TestMaterialGraph();
var nodeA = new TestableNode();

2
MaterialGraphProject/Assets/UnityShaderEditor/package.json


{
"name": "com.unity.shadergraph",
"description": "Shader Graph",
"version": "0.1.8",
"version": "0.1.9",
"unity": "2018.1",
"dependencies": {
}

4
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation/GraphObject.cs


namespace UnityEditor.Graphing
{
public class SerializableGraphObject : ScriptableObject, IGraphObject, ISerializationCallbackReceiver
public class GraphObject : ScriptableObject, IGraphObject, ISerializationCallbackReceiver
{
[SerializeField]
SerializationHelper.JSONSerializedElement m_SerializedGraph;

if (graph == null)
graph = deserializedGraph;
else
m_DeserializedGraph = deserializedGraph; // graph.ReplaceWith(m_DeserializedGraph);
m_DeserializedGraph = deserializedGraph;
}
void Validate()

3
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Interfaces/Graph.meta


fileFormatVersion: 2
guid: 20d63795c62940409089af61496db945
timeCreated: 1513348939

7
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/TestMaterialGraph.cs


namespace UnityEditor.ShaderGraph
{
class TestMaterialGraph : AbstractMaterialGraph
{
}
}

3
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/TestMaterialGraph.cs.meta


fileFormatVersion: 2
guid: 803f320a1aae4bb28cd8234a7623f9df
timeCreated: 1513335106

7
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/TestNode.cs


namespace UnityEditor.ShaderGraph
{
public class TestNode : AbstractMaterialNode
{
}
}

3
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/TestNode.cs.meta


fileFormatVersion: 2
guid: 5b3ff0f8519f4c0aa38ae4251a329e34
timeCreated: 1513341923

33
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/TestSlot.cs


using UnityEditor.Graphing;
namespace UnityEditor.ShaderGraph
{
public class TestSlot : MaterialSlot
{
public TestSlot(int slotId, string displayName, SlotType slotType, ShaderStage shaderStage = ShaderStage.Dynamic, bool hidden = false)
: base(slotId, displayName, displayName, slotType, shaderStage, hidden) {}
public TestSlot(int slotId, string displayName, SlotType slotType, int priority, ShaderStage shaderStage = ShaderStage.Dynamic, bool hidden = false)
: base(slotId, displayName, displayName, slotType, priority, shaderStage, hidden) {}
public override SlotValueType valueType
{
get { throw new System.NotImplementedException(); }
}
public override ConcreteSlotValueType concreteValueType
{
get { throw new System.NotImplementedException(); }
}
public override void AddDefaultProperty(PropertyCollector properties, GenerationMode generationMode)
{
throw new System.NotImplementedException();
}
public override void CopyValuesFrom(MaterialSlot foundSlot)
{
throw new System.NotImplementedException();
}
}
}

3
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/TestSlot.cs.meta


fileFormatVersion: 2
guid: e7e4d50a46ff471096f3c60fb06a364d
timeCreated: 1513346708

11
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Interfaces/MaterialGraphChange.cs.meta


fileFormatVersion: 2
guid: 53af639a9c00c2740ba7f23e2b38cf34
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

38
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Interfaces/MaterialGraphChange.cs


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEditor.Graphing;
namespace UnityEditor.ShaderGraph
{
public class ShaderPropertyAdded : GraphChange
{
public ShaderPropertyAdded(IShaderProperty shaderProperty)
{
this.shaderProperty = shaderProperty;
}
public IShaderProperty shaderProperty { get; private set; }
}
public class ShaderPropertyRemoved : GraphChange
{
public ShaderPropertyRemoved(Guid guid)
{
this.guid = guid;
}
public Guid guid { get; private set; }
}
public class LayerRemoved : GraphChange
{
public LayerRemoved(Guid id)
{
this.id = id;
}
public Guid id { get; private set; }
}
}

8
MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph.meta


fileFormatVersion: 2
guid: e47723110397ff04388ed94332cd6208
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

3
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Interfaces/Graph/GraphChange.cs.meta


fileFormatVersion: 2
guid: cbfac7ed81744ca281be9e21eae861c7
timeCreated: 1505620762

46
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Interfaces/Graph/GraphChange.cs


using System;
namespace UnityEditor.Graphing
{
public abstract class GraphChange {}
public sealed class NodeAddedGraphChange : GraphChange
{
public NodeAddedGraphChange(INode node)
{
this.node = node;
}
public INode node { get; private set; }
}
public sealed class NodeRemovedGraphChange : GraphChange
{
public NodeRemovedGraphChange(INode node)
{
this.node = node;
}
public INode node { get; private set; }
}
public sealed class EdgeAddedGraphChange : GraphChange
{
public EdgeAddedGraphChange(IEdge edge)
{
this.edge = edge;
}
public IEdge edge { get; private set; }
}
public sealed class EdgeRemovedGraphChange : GraphChange
{
public EdgeRemovedGraphChange(IEdge edge)
{
this.edge = edge;
}
public IEdge edge { get; private set; }
}
}

12
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation/SerializableGraph.cs.meta


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

12
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation/SerializableNode.cs.meta


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

12
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation/SerializableSlot.cs.meta


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

134
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation/SerializableSlot.cs


using System;
using System.Linq;
using UnityEngine;
namespace UnityEditor.Graphing
{
[Serializable]
public class SerializableSlot : ISlot
{
private const string kNotInit = "Not Initilaized";
[SerializeField]
private int m_Id;
[SerializeField]
private string m_DisplayName = kNotInit;
[SerializeField]
private SlotType m_SlotType = SlotType.Input;
[SerializeField]
private int m_Priority = int.MaxValue;
[SerializeField]
private bool m_Hidden;
public SlotReference slotReference
{
get { return new SlotReference(owner.guid, m_Id); }
}
public INode owner { get; set; }
public bool hidden
{
get { return m_Hidden; }
set { m_Hidden = value; }
}
public int id
{
get { return m_Id; }
}
public virtual string displayName
{
get { return m_DisplayName; }
set { m_DisplayName = value; }
}
public int priority
{
get { return m_Priority; }
set { m_Priority = value; }
}
public bool isInputSlot
{
get { return m_SlotType == SlotType.Input; }
}
public bool isOutputSlot
{
get { return m_SlotType == SlotType.Output; }
}
public SlotType slotType
{
get { return m_SlotType; }
}
// used via reflection / serialization after deserialize
// to reconstruct this slot.
public SerializableSlot()
{}
public SerializableSlot(int id, string displayName, SlotType slotType, int priority, bool hidden = false)
{
m_Id = id;
m_DisplayName = displayName;
m_SlotType = slotType;
m_Priority = priority;
m_Hidden = hidden;
}
public SerializableSlot(int id, string displayName, SlotType slotType, bool hidden = false)
{
m_Id = id;
m_DisplayName = displayName;
m_SlotType = slotType;
m_Hidden = hidden;
}
protected bool Equals(SerializableSlot other)
{
return m_Id == other.m_Id && owner.guid.Equals(other.owner.guid);
}
public bool Equals(ISlot other)
{
return Equals(other as object);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((SerializableSlot)obj);
}
public override int GetHashCode()
{
unchecked
{
return (m_Id * 397) ^ (owner != null ? owner.GetHashCode() : 0);
}
}
public bool isConnected
{
get
{
// node and graph respectivly
if (owner == null || owner.owner == null)
return false;
var graph = owner.owner;
var edges = graph.GetEdges(slotReference);
return edges.Any();
}
}
}
}

360
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation/SerializableGraph.cs


using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace UnityEditor.Graphing
{
[Serializable]
public class SerializableGraph : IGraph, ISerializationCallbackReceiver
{
[NonSerialized]
List<IEdge> m_Edges = new List<IEdge>();
[NonSerialized]
Dictionary<Guid, List<IEdge>> m_NodeEdges = new Dictionary<Guid, List<IEdge>>();
[NonSerialized]
Dictionary<Guid, INode> m_Nodes = new Dictionary<Guid, INode>();
[SerializeField]
List<SerializationHelper.JSONSerializedElement> m_SerializableNodes = new List<SerializationHelper.JSONSerializedElement>();
[SerializeField]
List<SerializationHelper.JSONSerializedElement> m_SerializableEdges = new List<SerializationHelper.JSONSerializedElement>();
[NonSerialized]
List<INode> m_AddedNodes = new List<INode>();
[NonSerialized]
List<INode> m_RemovedNodes = new List<INode>();
[NonSerialized]
List<IEdge> m_AddedEdges = new List<IEdge>();
[NonSerialized]
List<IEdge> m_RemovedEdges = new List<IEdge>();
public IEnumerable<INode> addedNodes
{
get { return m_AddedNodes; }
}
public IEnumerable<INode> removedNodes
{
get { return m_RemovedNodes; }
}
public IEnumerable<IEdge> addedEdges
{
get { return m_AddedEdges; }
}
public IEnumerable<IEdge> removedEdges
{
get { return m_RemovedEdges; }
}
public IGraphObject owner { get; set; }
public virtual void ClearChanges()
{
m_AddedNodes.Clear();
m_RemovedNodes.Clear();
m_AddedEdges.Clear();
m_RemovedEdges.Clear();
}
public IEnumerable<T> GetNodes<T>() where T : INode
{
return m_Nodes.Values.OfType<T>();
}
public IEnumerable<IEdge> edges
{
get { return m_Edges; }
}
public virtual void AddNode(INode node)
{
AddNodeNoValidate(node);
ValidateGraph();
}
protected void AddNodeNoValidate(INode node)
{
m_Nodes.Add(node.guid, node);
node.owner = this;
m_AddedNodes.Add(node);
}
public virtual void RemoveNode(INode node)
{
if (!node.canDeleteNode)
return;
m_Nodes.Remove(node.guid);
m_RemovedNodes.Add(node);
ValidateGraph();
}
protected void RemoveNodeNoValidate(INode node)
{
if (!node.canDeleteNode)
return;
m_Nodes.Remove(node.guid);
m_RemovedNodes.Add(node);
}
void AddEdgeToNodeEdges(IEdge edge)
{
List<IEdge> inputEdges;
if (!m_NodeEdges.TryGetValue(edge.inputSlot.nodeGuid, out inputEdges))
m_NodeEdges[edge.inputSlot.nodeGuid] = inputEdges = new List<IEdge>();
inputEdges.Add(edge);
List<IEdge> outputEdges;
if (!m_NodeEdges.TryGetValue(edge.outputSlot.nodeGuid, out outputEdges))
m_NodeEdges[edge.outputSlot.nodeGuid] = outputEdges = new List<IEdge>();
outputEdges.Add(edge);
}
public virtual Dictionary<SerializationHelper.TypeSerializationInfo, SerializationHelper.TypeSerializationInfo> GetLegacyTypeRemapping()
{
return new Dictionary<SerializationHelper.TypeSerializationInfo, SerializationHelper.TypeSerializationInfo>();
}
static List<IEdge> s_TempEdges = new List<IEdge>();
protected IEdge ConnectNoValidate(SlotReference fromSlotRef, SlotReference toSlotRef)
{
var fromNode = GetNodeFromGuid(fromSlotRef.nodeGuid);
var toNode = GetNodeFromGuid(toSlotRef.nodeGuid);
if (fromNode == null || toNode == null)
return null;
// if fromNode is already connected to toNode
// do now allow a connection as toNode will then
// have an edge to fromNode creating a cycle.
// if this is parsed it will lead to an infinite loop.
var dependentNodes = new List<INode>();
NodeUtils.CollectNodesNodeFeedsInto(dependentNodes, toNode);
if (dependentNodes.Contains(fromNode))
return null;
var fromSlot = fromNode.FindSlot<ISlot>(fromSlotRef.slotId);
var toSlot = toNode.FindSlot<ISlot>(toSlotRef.slotId);
if (fromSlot.isOutputSlot == toSlot.isOutputSlot)
return null;
var outputSlot = fromSlot.isOutputSlot ? fromSlotRef : toSlotRef;
var inputSlot = fromSlot.isInputSlot ? fromSlotRef : toSlotRef;
s_TempEdges.Clear();
GetEdges(inputSlot, s_TempEdges);
// remove any inputs that exits before adding
foreach (var edge in s_TempEdges)
{
RemoveEdgeNoValidate(edge);
}
var newEdge = new Edge(outputSlot, inputSlot);
m_Edges.Add(newEdge);
m_AddedEdges.Add(newEdge);
AddEdgeToNodeEdges(newEdge);
//Debug.LogFormat("Connected edge: {0} -> {1} ({2} -> {3})\n{4}", newEdge.outputSlot.nodeGuid, newEdge.inputSlot.nodeGuid, fromNode.name, toNode.name, Environment.StackTrace);
return newEdge;
}
public virtual IEdge Connect(SlotReference fromSlotRef, SlotReference toSlotRef)
{
var newEdge = ConnectNoValidate(fromSlotRef, toSlotRef);
ValidateGraph();
return newEdge;
}
public virtual void RemoveEdge(IEdge e)
{
RemoveEdgeNoValidate(e);
ValidateGraph();
}
public void RemoveElements(IEnumerable<INode> nodes, IEnumerable<IEdge> edges)
{
foreach (var edge in edges.ToArray())
RemoveEdgeNoValidate(edge);
foreach (var serializableNode in nodes.ToArray())
RemoveNodeNoValidate(serializableNode);
ValidateGraph();
}
protected void RemoveEdgeNoValidate(IEdge e)
{
e = m_Edges.FirstOrDefault(x => x.Equals(e));
if (e == null)
throw new ArgumentException("Trying to remove an edge that does not exist.", "e");
m_Edges.Remove(e);
List<IEdge> inputNodeEdges;
if (m_NodeEdges.TryGetValue(e.inputSlot.nodeGuid, out inputNodeEdges))
inputNodeEdges.Remove(e);
List<IEdge> outputNodeEdges;
if (m_NodeEdges.TryGetValue(e.outputSlot.nodeGuid, out outputNodeEdges))
outputNodeEdges.Remove(e);
m_RemovedEdges.Add(e);
}
public INode GetNodeFromGuid(Guid guid)
{
INode node;
m_Nodes.TryGetValue(guid, out node);
return node;
}
public bool ContainsNodeGuid(Guid guid)
{
return m_Nodes.ContainsKey(guid);
}
public T GetNodeFromGuid<T>(Guid guid) where T : INode
{
var node = GetNodeFromGuid(guid);
if (node is T)
return (T)node;
return default(T);
}
public void GetEdges(SlotReference s, List<IEdge> foundEdges)
{
var node = GetNodeFromGuid(s.nodeGuid);
if (node == null)
{
Debug.LogWarning("Node does not exist");
return;
}
ISlot slot = node.FindSlot<ISlot>(s.slotId);
List<IEdge> candidateEdges;
if (!m_NodeEdges.TryGetValue(s.nodeGuid, out candidateEdges))
return;
foreach (var edge in candidateEdges)
{
var cs = slot.isInputSlot ? edge.inputSlot : edge.outputSlot;
if (cs.nodeGuid == s.nodeGuid && cs.slotId == s.slotId)
foundEdges.Add(edge);
}
}
public virtual void OnBeforeSerialize()
{
m_SerializableNodes = SerializationHelper.Serialize<INode>(m_Nodes.Values);
m_SerializableEdges = SerializationHelper.Serialize<IEdge>(m_Edges);
}
public virtual void OnAfterDeserialize()
{
var nodes = SerializationHelper.Deserialize<INode>(m_SerializableNodes, GetLegacyTypeRemapping());
m_Nodes = new Dictionary<Guid, INode>(nodes.Count);
foreach (var node in nodes)
{
node.owner = this;
node.UpdateNodeAfterDeserialization();
m_Nodes.Add(node.guid, node);
}
m_SerializableNodes = null;
m_Edges = SerializationHelper.Deserialize<IEdge>(m_SerializableEdges, null);
m_SerializableEdges = null;
foreach (var edge in m_Edges)
AddEdgeToNodeEdges(edge);
}
public virtual void ValidateGraph()
{
//First validate edges, remove any
//orphans. This can happen if a user
//manually modifies serialized data
//of if they delete a node in the inspector
//debug view.
foreach (var edge in edges.ToArray())
{
var outputNode = GetNodeFromGuid(edge.outputSlot.nodeGuid);
var inputNode = GetNodeFromGuid(edge.inputSlot.nodeGuid);
if (outputNode == null
|| inputNode == null
|| outputNode.FindOutputSlot<ISlot>(edge.outputSlot.slotId) == null
|| inputNode.FindInputSlot<ISlot>(edge.inputSlot.slotId) == null)
{
//orphaned edge
RemoveEdgeNoValidate(edge);
}
}
foreach (var node in GetNodes<INode>())
node.ValidateNode();
foreach (var edge in m_AddedEdges.ToList())
{
if (!ContainsNodeGuid(edge.outputSlot.nodeGuid) || !ContainsNodeGuid(edge.inputSlot.nodeGuid))
{
Debug.LogWarningFormat("Added edge is invalid: {0} -> {1}\n{2}", edge.outputSlot.nodeGuid, edge.inputSlot.nodeGuid, Environment.StackTrace);
m_AddedEdges.Remove(edge);
}
}
}
public virtual void ReplaceWith(IGraph other)
{
other.ValidateGraph();
ValidateGraph();
// Current tactic is to remove all nodes and edges and then re-add them, such that depending systems
// will re-initialize with new references.
using (var pooledList = ListPool<IEdge>.GetDisposable())
{
var removedNodeEdges = pooledList.value;
removedNodeEdges.AddRange(m_Edges);
foreach (var edge in removedNodeEdges)
RemoveEdgeNoValidate(edge);
}
using (var removedNodesPooledObject = ListPool<Guid>.GetDisposable())
{
var removedNodeGuids = removedNodesPooledObject.value;
removedNodeGuids.AddRange(m_Nodes.Keys);
foreach (var nodeGuid in removedNodeGuids)
RemoveNodeNoValidate(m_Nodes[nodeGuid]);
}
ValidateGraph();
foreach (var node in other.GetNodes<INode>())
AddNodeNoValidate(node);
foreach (var edge in other.edges)
ConnectNoValidate(edge.outputSlot, edge.inputSlot);
ValidateGraph();
}
public void OnEnable()
{
foreach (var node in GetNodes<INode>().OfType<IOnAssetEnabled>())
{
node.OnEnable();
}
}
}
}

219
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation/SerializableNode.cs


using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace UnityEditor.Graphing
{
[Serializable]
public class SerializableNode : INode, ISerializationCallbackReceiver
{
[NonSerialized]
private Guid m_Guid;
[SerializeField]
private string m_GuidSerialized;
[SerializeField]
private string m_Name;
[SerializeField]
private DrawState m_DrawState;
[NonSerialized]
private List<ISlot> m_Slots = new List<ISlot>();
[SerializeField]
List<SerializationHelper.JSONSerializedElement> m_SerializableSlots = new List<SerializationHelper.JSONSerializedElement>();
public IGraph owner { get; set; }
public Guid guid
{
get { return m_Guid; }
}
public string name
{
get { return m_Name; }
set { m_Name = value; }
}
public virtual bool canDeleteNode
{
get { return true; }
}
public DrawState drawState
{
get { return m_DrawState; }
set
{
m_DrawState = value;
if (onModified != null)
onModified(this, ModificationScope.Node);
}
}
public virtual bool hasError { get; protected set; }
public SerializableNode()
{
m_DrawState.expanded = true;
m_Guid = Guid.NewGuid();
}
public Guid RewriteGuid()
{
m_Guid = Guid.NewGuid();
return m_Guid;
}
public virtual void ValidateNode()
{}
public OnNodeModified onModified { get; set; }
public void GetInputSlots<T>(List<T> foundSlots) where T : ISlot
{
foreach (var slot in m_Slots)
{
if (slot.isInputSlot && slot is T)
foundSlots.Add((T)slot);
}
}
public void GetOutputSlots<T>(List<T> foundSlots) where T : ISlot
{
foreach (var slot in m_Slots)
{
if (slot.isOutputSlot && slot is T)
foundSlots.Add((T)slot);
}
}
public void GetSlots<T>(List<T> foundSlots) where T : ISlot
{
foreach (var slot in m_Slots)
{
if (slot is T)
foundSlots.Add((T)slot);
}
}
public virtual void AddSlot(ISlot slot)
{
if (slot == null)
return;
m_Slots.RemoveAll(x => x.id == slot.id);
m_Slots.Add(slot);
slot.owner = this;
if (onModified != null)
{
onModified(this, ModificationScope.Topological);
}
}
public void RemoveSlot(int slotId)
{
// Remove edges that use this slot
// no owner can happen after creation
// but before added to graph
if (owner != null)
{
var edges = owner.GetEdges(GetSlotReference(slotId));
foreach (var edge in edges.ToArray())
owner.RemoveEdge(edge);
}
//remove slots
m_Slots.RemoveAll(x => x.id == slotId);
if (onModified != null)
{
onModified(this, ModificationScope.Topological);
}
}
public void RemoveSlotsNameNotMatching(IEnumerable<int> slotIds, bool supressWarnings = false)
{
var invalidSlots = m_Slots.Select(x => x.id).Except(slotIds);
foreach (var invalidSlot in invalidSlots.ToArray())
{
if (!supressWarnings)
Debug.LogWarningFormat("Removing Invalid MaterialSlot: {0}", invalidSlot);
RemoveSlot(invalidSlot);
}
}
public SlotReference GetSlotReference(int slotId)
{
var slot = FindSlot<ISlot>(slotId);
if (slot == null)
throw new ArgumentException("Slot could not be found", "slotId");
return new SlotReference(guid, slotId);
}
public T FindSlot<T>(int slotId) where T : ISlot
{
foreach (var slot in m_Slots)
{
if (slot.id == slotId && slot is T)
return (T)slot;
}
return default(T);
}
public T FindInputSlot<T>(int slotId) where T : ISlot
{
foreach (var slot in m_Slots)
{
if (slot.isInputSlot && slot.id == slotId && slot is T)
return (T)slot;
}
return default(T);
}
public T FindOutputSlot<T>(int slotId) where T : ISlot
{
foreach (var slot in m_Slots)
{
if (slot.isOutputSlot && slot.id == slotId && slot is T)
return (T)slot;
}
return default(T);
}
public virtual IEnumerable<ISlot> GetInputsWithNoConnection()
{
return this.GetInputSlots<ISlot>().Where(x => !owner.GetEdges(GetSlotReference(x.id)).Any());
}
public virtual void OnBeforeSerialize()
{
m_GuidSerialized = m_Guid.ToString();
m_SerializableSlots = SerializationHelper.Serialize<ISlot>(m_Slots);
}
public virtual void OnAfterDeserialize()
{
if (!string.IsNullOrEmpty(m_GuidSerialized))
m_Guid = new Guid(m_GuidSerialized);
else
m_Guid = Guid.NewGuid();
m_Slots = SerializationHelper.Deserialize<ISlot>(m_SerializableSlots, null);
m_SerializableSlots = null;
foreach (var s in m_Slots)
s.owner = this;
UpdateNodeAfterDeserialization();
}
public virtual void UpdateNodeAfterDeserialization()
{}
}
}

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Implementation.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Assets/IGraphAsset.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Interfaces/Graph/IGraphAsset.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Assets/IGraphAsset.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Interfaces/Graph/IGraphAsset.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Util/ListPool.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/ListPool.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Util/Logging.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/Logging.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Util/ObjectPool.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/ObjectPool.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Util/SerializationHelper.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/SerializationHelper.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Util/PooledObject.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/PooledObject.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Util/DictionaryPool.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/DictionaryPool.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Util/QueuePool.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/QueuePool.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Util/StackPool.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/StackPool.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Util/DictionaryPool.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/DictionaryPool.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Util/ListPool.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/ListPool.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Util/Logging.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/Logging.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Util/ObjectPool.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/ObjectPool.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Util/PooledObject.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/PooledObject.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Util/QueuePool.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/QueuePool.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Util/SerializationHelper.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/SerializationHelper.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Util/StackPool.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Util/StackPool.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Interfaces → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Interfaces/Graph

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/SerializableGraph/Implementation → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation/SerializableGraphObject.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation/GraphObject.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation/SerializableGraphObject.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Implementation/GraphObject.cs

正在加载...
取消
保存