浏览代码

Start work on making 'sub-graph' work again in an expected way.

/main
Tim Cooper 7 年前
当前提交
34cc0f15
共有 33 个文件被更改,包括 414 次插入528 次删除
  1. 8
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Runtime/Assets/IGraphAsset.cs
  2. 33
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Runtime/Assets/SerializableGraphAsset.cs
  3. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/AssetCallbacks/CreateRemapGraph.cs
  4. 9
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/AssetCallbacks/CreateShaderSubGraph.cs
  5. 65
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/MaterialGraphPresenter.cs
  6. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/Nodes/RemapInputNodePresenter.cs
  7. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/Nodes/RemapMasterNodePresenter.cs
  8. 22
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/TitleBarPresenter.cs
  9. 16
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/MaterialGraphView.cs
  10. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderGraphImporter.cs
  11. 8
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderSubGraphImporter.cs
  12. 16
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Util/CreateSerializableGraph.cs
  13. 27
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Graphs/AbstractMaterialGraphAsset.cs
  14. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Graphs/IMaterialGraphAsset.cs
  15. 25
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Graphs/MaterialGraphAsset.cs
  16. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Remapper/MasterRemapGraph.cs
  17. 3
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Remapper/MasterRemapInputNode.cs
  18. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Remapper/MaterialRemapAsset.cs
  19. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Remapper/RemapMasterNode.cs
  20. 15
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/SubGraph/MaterialSubGraphAsset.cs
  21. 6
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/SubGraph/SubGraph.cs
  22. 230
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/AbstractMaterialGraphEditWindow.cs
  23. 13
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/AbstractMaterialGraphEditWindow.cs.meta
  24. 42
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderSubGraphImporterEditor.cs
  25. 13
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderSubGraphImporterEditor.cs.meta
  26. 36
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/Graphs/graphs_Cracks.mat
  27. 10
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/Graphs/graphs_Cracks.mat.meta
  28. 12
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphEditWindow.cs.meta
  29. 211
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphEditWindow.cs
  30. 71
      MaterialGraphProject/UnityProject.sln.DotSettings
  31. 2
      MaterialGraphProject/MaterialGraphProject.CSharp.Editor.csproj.DotSettings
  32. 2
      MaterialGraphProject/MaterialGraphProject.CSharp.csproj.DotSettings
  33. 15
      MaterialGraphProject/MaterialGraphProject.sln.DotSettings.user

8
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Runtime/Assets/IGraphAsset.cs


namespace UnityEngine.Graphing
{
public interface IGraphAsset
{
IGraph graph { get; }
bool shouldRepaint { get; }
GraphDrawingData drawingData { get; }
ScriptableObject GetScriptableObject();
void OnEnable();
}
}

33
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Runtime/Assets/SerializableGraphAsset.cs


namespace UnityEngine.Graphing
{
public class SerializableGraphAsset : ScriptableObject, IGraphAsset, IOnAssetEnabled
{
[SerializeField]
private SerializableGraph m_Graph = new SerializableGraph();
public IGraph graph
{
get { return m_Graph; }
}
public bool shouldRepaint
{
get { return false; }
}
public ScriptableObject GetScriptableObject()
{
return this;
}
public void OnEnable()
{
graph.OnEnable();
}
[SerializeField]
private GraphDrawingData m_DrawingData = new GraphDrawingData();
public GraphDrawingData drawingData
{
get { return m_DrawingData; }
}
}
}

4
MaterialGraphProject/Assets/UnityShaderEditor/Editor/AssetCallbacks/CreateRemapGraph.cs


public override void Action(int instanceId, string pathName, string resourceFile)
{
var graph = CreateInstance<MaterialRemapAsset>();
/* var graph = CreateInstance<MaterialRemapAsset>();
AssetDatabase.CreateAsset(graph, pathName);
AssetDatabase.CreateAsset(graph, pathName);*/
}
}
}

9
MaterialGraphProject/Assets/UnityShaderEditor/Editor/AssetCallbacks/CreateShaderSubGraph.cs


public override void Action(int instanceId, string pathName, string resourceFile)
{
var graph = CreateInstance<MaterialSubGraphAsset>();
graph.name = Path.GetFileName(pathName);
AssetDatabase.CreateAsset(graph, pathName);
graph.PostCreate();
var graph = new SubGraph();
graph.AddNode(new SubGraphInputNode());
graph.AddNode(new SubGraphOutputNode());
File.WriteAllText(pathName, EditorJsonUtility.ToJson(graph));
AssetDatabase.Refresh();
}
}
}

65
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/MaterialGraphPresenter.cs


{
protected GraphTypeMapper typeMapper { get; set; }
public IGraphAsset graphAsset { get; private set; }
public IGraph graph { get; private set; }
EditorWindow m_Container;
IMaterialGraphEditWindow m_Container;
[SerializeField]
TitleBarPresenter m_TitleBar;

typeMapper[typeof(SphericalIndentationNode)] = typeof(AnyNodePresenter); // anything derived from AnyNode should use the AnyNodePresenter
typeMapper[typeof(AACheckerboardNode)] = typeof(AnyNodePresenter); // anything derived from AnyNode should use the AnyNodePresenter
typeMapper[typeof(AACheckerboard3dNode)] = typeof(AnyNodePresenter); // anything derived from AnyNode should use the AnyNodePresenter*/
typeMapper[typeof(SubGraphNode)] = typeof(SubgraphNodePresenter);
typeMapper[typeof(RemapMasterNode)] = typeof(RemapMasterNodePresenter);
typeMapper[typeof(MasterRemapInputNode)] = typeof(RemapInputNodePresenter);
// typeMapper[typeof(SubGraphNode)] = typeof(SubgraphNodePresenter);
// typeMapper[typeof(RemapMasterNode)] = typeof(RemapMasterNodePresenter);
// typeMapper[typeof(MasterRemapInputNode)] = typeof(RemapInputNodePresenter);
typeMapper[typeof(AbstractSubGraphIONode)] = typeof(SubgraphIONodePresenter);
typeMapper[typeof(AbstractSurfaceMasterNode)] = typeof(SurfaceMasterNodePresenter);
typeMapper[typeof(LevelsNode)] = typeof(LevelsNodePresenter);

if (scope == ModificationScope.Topological)
UpdateData();
EditorUtility.SetDirty(graphAsset.GetScriptableObject());
if (m_Container != null)
m_Container.Repaint();

// Find all nodes currently being drawn which are no longer in the graph (i.e. deleted)
var deletedElements = m_Elements
.OfType<MaterialNodePresenter>()
.Where(nd => !graphAsset.graph.GetNodes<INode>().Contains(nd.node))
.Where(nd => !graph.GetNodes<INode>().Contains(nd.node))
.Where(ed => !graphAsset.graph.edges.Contains(ed.edge));
.Where(ed => !graph.edges.Contains(ed.edge));
// Find all edges currently being drawn which are no longer in the graph (i.e. deleted)
foreach (var edgeData in deletedEdges)

var addedNodes = new List<MaterialNodePresenter>();
// Find all new nodes and mark for addition
foreach (var node in graphAsset.graph.GetNodes<INode>())
foreach (var node in graph.GetNodes<INode>())
{
// Check whether node already exists
if (m_Elements.OfType<MaterialNodePresenter>().Any(e => e.node == node))

m_Elements.AddRange(addedNodes.OfType<GraphElementPresenter>());
// Find edges in the graph that are not being drawn and create edge data for them
foreach (var edge in graphAsset.graph.edges)
foreach (var edge in graph.edges)
var fromNode = graphAsset.graph.GetNodeFromGuid(edge.outputSlot.nodeGuid);
var fromNode = graph.GetNodeFromGuid(edge.outputSlot.nodeGuid);
var toNode = graphAsset.graph.GetNodeFromGuid(edge.inputSlot.nodeGuid);
var toNode = graph.GetNodeFromGuid(edge.inputSlot.nodeGuid);
var toSlot = toNode.FindInputSlot<ISlot>(edge.inputSlot.slotId);
var targetNode = m_Elements.OfType<MaterialNodePresenter>().FirstOrDefault(x => x.node == toNode);
var targetAnchors = targetNode.inputAnchors.OfType<GraphAnchorPresenter>();

m_Elements.AddRange(drawableEdges.OfType<GraphElementPresenter>());
}
public virtual void Initialize(IGraphAsset graphAsset, MaterialGraphEditWindow container)
public virtual void Initialize(IGraph graph, IMaterialGraphEditWindow container)
this.graphAsset = graphAsset;
this.graph = graph;
m_Container = container;
m_TitleBar = CreateInstance<TitleBarPresenter>();

m_GraphInspectorPresenter.Initialize();
if (graphAsset == null)
if (graph == null)
return;
UpdateData();

{
graphAsset.graph.AddNode(node);
EditorUtility.SetDirty(graphAsset.GetScriptableObject());
graph.AddNode(node);
graphAsset.graph.RemoveElements(nodes.Select(x => x.node), edges.Select(x => x.edge));
graphAsset.graph.ValidateGraph();
EditorUtility.SetDirty(graphAsset.GetScriptableObject());
graph.RemoveElements(nodes.Select(x => x.node), edges.Select(x => x.edge));
graph.ValidateGraph();
UpdateData();
}

{
graphAsset.graph.Connect(left.slot.slotReference, right.slot.slotReference);
EditorUtility.SetDirty(graphAsset.GetScriptableObject());
graph.Connect(left.slot.slotReference, right.slot.slotReference);
UpdateData();
}
}

}
}
void InsertCopyPasteGraph(CopyPasteGraph graph)
void InsertCopyPasteGraph(CopyPasteGraph copyGraph)
if (graph == null || graphAsset == null || graphAsset.graph == null)
if (copyGraph == null || graph == null)
foreach (var node in graph.GetNodes<INode>())
foreach (var node in copyGraph.GetNodes<INode>())
{
var oldGuid = node.guid;
var newGuid = node.RewriteGuid();

position.y += 30;
drawState.position = position;
node.drawState = drawState;
graphAsset.graph.AddNode(node);
graph.AddNode(node);
addedNodes.Add(node);
}

foreach (var edge in graph.edges)
foreach (var edge in copyGraph.edges)
{
var outputSlot = edge.outputSlot;
var inputSlot = edge.inputSlot;

{
var outputSlotRef = new SlotReference(remappedOutputNodeGuid, outputSlot.slotId);
var inputSlotRef = new SlotReference(remappedInputNodeGuid, inputSlot.slotId);
addedEdges.Add(graphAsset.graph.Connect(outputSlotRef, inputSlotRef));
addedEdges.Add(graph.Connect(outputSlotRef, inputSlotRef));
graphAsset.graph.ValidateGraph();
graph.ValidateGraph();
graphAsset.drawingData.selection = addedNodes.Select(n => n.guid);
//TODO: Fix this
//graphAsset.drawingData.selection = addedNodes.Select(n => n.guid);
}
public bool canCopy

public void UpdateSelection(IEnumerable<MaterialNodePresenter> presenters)
{
if (graphAsset == null)
if (graph == null)
graphAsset.drawingData.selection = presenters.Select(x => x.node.guid);
//TODO: Fix this
//graphAsset.drawingData.selection = presenters.Select(x => x.node.guid);
m_GraphInspectorPresenter.UpdateSelection(presenters.Select(x => x.node));
}

4
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/Nodes/RemapInputNodePresenter.cs


namespace UnityEditor.MaterialGraph.Drawing
{
[Serializable]
/>an class="p">* [Serializable]
class RemapInputControlPresenter : GraphControlPresenter
{
public override void OnGUIHandler()

instance.Initialize(node);
return new List<GraphControlPresenter> { instance };
}
}
}*/
}

4
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/Nodes/RemapMasterNodePresenter.cs


namespace UnityEditor.MaterialGraph.Drawing
{
[Serializable]
/>an class="p">* [Serializable]
class RemapMasterControlPresenter : GraphControlPresenter
{
public override void OnGUIHandler()

controls.Add(instance);
return controls;
}
}
}*/
}

22
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/TitleBarPresenter.cs


{
List<TitleBarButtonPresenter> m_leftItems;
List<TitleBarButtonPresenter> m_rightItems;
MaterialGraphEditWindow m_Owner;
IMaterialGraphEditWindow m_Owner;
public IEnumerable<TitleBarButtonPresenter> leftItems
{

protected TitleBarPresenter()
{}
public void Initialize(MaterialGraphEditWindow graphWindow)
public void Initialize(IMaterialGraphEditWindow graphWindow)
{
m_Owner = graphWindow;
m_leftItems = new List<TitleBarButtonPresenter>();

{
if (m_Owner != null)
m_Owner.PingAsset ();
}
public static List<IGraphAsset> FindAssets()
{
var assets = new List<IGraphAsset>();
List<string> guids = AssetDatabase.FindAssets(string.Format("t:MaterialGraphAsset", typeof(MaterialGraphAsset))).ToList();
guids.AddRange( AssetDatabase.FindAssets(string.Format("t:MaterialSubGraphAsset", typeof(MaterialSubGraphAsset))));
for( int i = 0; i < guids.Count; i++ )
{
string assetPath = AssetDatabase.GUIDToAssetPath( guids[i] );
ScriptableObject asset = AssetDatabase.LoadAssetAtPath<ScriptableObject>( assetPath );
if( asset != null && EditorUtility.IsPersistent(asset) && asset is IGraphAsset)
{
assets.Add((IGraphAsset)asset);
}
}
return assets;
}
void UpdateAsset()

16
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/MaterialGraphView.cs


{
public sealed class MaterialGraphView : GraphView
{
[SerializeField]
private GraphDrawingData m_DrawingData = new GraphDrawingData();
public GraphDrawingData drawingData
{
get { return m_DrawingData; }
}
public MaterialGraphView(EditorWindow editorWindow)
{
var shortcutHandler = new ShortcutHandler(

var graphDataSource = GetPresenter<MaterialGraphPresenter>();
if (graphDataSource == null)
return;
if (drawingData.selection.SequenceEqual(selection.OfType<MaterialNodeView>().Select(d => ((MaterialNodePresenter) d.presenter).node.guid))) return;
var graphAsset = graphDataSource.graphAsset;
if (graphAsset == null || graphAsset.drawingData.selection.SequenceEqual(selection.OfType<MaterialNodeView>().Select(d => ((MaterialNodePresenter) d.presenter).node.guid))) return;
var selectedDrawers = graphDataSource.graphAsset.drawingData.selection
var selectedDrawers = drawingData.selection
.Select(guid => contentViewContainer
.OfType<MaterialNodeView>()
.FirstOrDefault(drawer => ((MaterialNodePresenter) drawer.presenter).node.guid == guid))

4
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderGraphImporter.cs


private static void ShowGraphEditWindow(string path)
{
var asset = AssetDatabase.LoadAssetAtPath<Shader>(path);
var asset = AssetDatabase.LoadAssetAtPath<Object>(path);
var windows = Resources.FindObjectsOfTypeAll<MaterialGraphEditWindow>();
bool foundWindow = false;
foreach (var w in windows)

foundWindow = true;
w.Focus();
w.Focus();
}
}

8
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderSubGraphImporter.cs


using UnityEditor.Experimental.AssetImporters;
using UnityEngine.MaterialGraph;
using UnityEngine;
using System;
using System.Collections.Generic;
using System.Linq;
#if UNITY_EDITOR
using System.Reflection;
using UnityEditor;
#endif
using UnityEngine.Graphing;
using System.Text;
[ScriptedImporter(1, "ShaderSubGraph")]

16
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Util/CreateSerializableGraph.cs


namespace UnityEditor.Graphing
{
public class CreateSerializableGraph : EndNameEditAction
{
[MenuItem("Assets/Create/Serializable Graph", false, 207)]
public static void CreateMaterialGraph()
{
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, CreateInstance<CreateSerializableGraph>(),
"New Shader Graph.ShaderGraph", null, null);
}
public override void Action(int instanceId, string pathName, string resourceFile)
{
var graph = CreateInstance<SerializableGraphAsset>();
graph.name = Path.GetFileName(pathName);
AssetDatabase.CreateAsset(graph, pathName);
}
}
}

27
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Graphs/AbstractMaterialGraphAsset.cs


namespace UnityEngine.MaterialGraph
{
public abstract class AbstractMaterialGraphAsset : ScriptableObject, IMaterialGraphAsset
{
public abstract IGraph graph { get; }
public bool shouldRepaint
{
get { return graph.GetNodes<AbstractMaterialNode>().OfType<IRequiresTime>().Any(); }
}
public ScriptableObject GetScriptableObject()
{
return this;
}
public void OnEnable()
{
graph.OnEnable();
}
[SerializeField]
private GraphDrawingData m_DrawingData = new GraphDrawingData();
public GraphDrawingData drawingData
{
get { return m_DrawingData; }
}
}
}

4
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Graphs/IMaterialGraphAsset.cs


namespace UnityEngine.MaterialGraph
{
public interface IMaterialGraphAsset : IGraphAsset
{
}
}

25
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Graphs/MaterialGraphAsset.cs


namespace UnityEngine.MaterialGraph
{
public class MaterialGraphAsset : AbstractMaterialGraphAsset
public class MaterialGraphAsset
[SerializeField]
private MaterialGraph m_MaterialGraph = new MaterialGraph();
[SerializeField]
private Shader m_GeneratedShader;
public override IGraph graph
{
get { return m_MaterialGraph; }
}
public MaterialGraph materialGraph
{
get { return m_MaterialGraph; }
set { m_MaterialGraph = value; }
}
#if UNITY_EDITOR
public static bool ShaderHasError(Shader shader)
{
var hasErrorsCall = typeof(ShaderUtil).GetMethod("GetShaderErrorCount", BindingFlags.Static | BindingFlags.NonPublic);

#endif
private int GetShaderInstanceID()
{
return m_GeneratedShader == null ? 0 : m_GeneratedShader.GetInstanceID();
}
}
}

4
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Remapper/MasterRemapGraph.cs


bool IsValidSlotConnection(int id);
}
[Serializable]
/>an class="p">* [Serializable]
public class MasterRemapGraph : AbstractMaterialGraph
{
[NonSerialized]

node.CollectPreviewMaterialProperties(properties);
}
}
}*/
}

3
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Remapper/MasterRemapInputNode.cs


namespace UnityEngine.MaterialGraph
{
/*
[Title("Remapper/Remap Input Node")]
public class MasterRemapInputNode : AbstractSubGraphIONode
, INodeGroupRemapper

return fromNode.GetVariableNameForSlot(outputRef.slotId);
}
}
}*/
}

4
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Remapper/MaterialRemapAsset.cs


namespace UnityEngine.MaterialGraph
{
public class MaterialRemapAsset : AbstractMaterialGraphAsset
/* public class MaterialRemapAsset : AbstractMaterialGraphAsset
{
[SerializeField]
private MasterRemapGraph m_MasterRemapGraph = new MasterRemapGraph();

{
get { return m_MasterRemapGraph; }
}
}
}*/
}

4
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Remapper/RemapMasterNode.cs


namespace UnityEngine.MaterialGraph
{
[Serializable]
/>an class="p">* [Serializable]
[Title("Master/Remapper")]
public class RemapMasterNode : AbstractMasterNode
, IOnAssetEnabled

}
RemoveSlotsNameNotMatching(validNames);
}
}
}*/
}

15
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/SubGraph/MaterialSubGraphAsset.cs


using System.Linq;
using UnityEngine.Graphing;
public class MaterialSubGraphAsset : AbstractMaterialGraphAsset
public class MaterialSubGraphAsset : ScriptableObject
public override IGraph graph
{
get { return m_MaterialSubGraph; }
}
}
public void PostCreate()
{
m_MaterialSubGraph.PostCreate();
}
}
}

6
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/SubGraph/SubGraph.cs


base.AddNode(node);
}
public void PostCreate()
{
AddNode(new SubGraphInputNode());
AddNode(new SubGraphOutputNode());
}
private IEnumerable<AbstractMaterialNode> usedNodes
{
get

230
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/AbstractMaterialGraphEditWindow.cs


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using UnityEditor.Experimental.UIElements.GraphView;
using UnityEngine;
using UnityEngine.Graphing;
using UnityEngine.MaterialGraph;
using Object = UnityEngine.Object;
namespace UnityEditor.MaterialGraph.Drawing
{
public interface IMaterialGraphEditWindow
{
void PingAsset();
void UpdateAsset();
void Repaint();
void ToggleRequiresTime();
}
public class MaterialGraphEditWindow : AbstractMaterialGraphEditWindow<UnityEngine.MaterialGraph.MaterialGraph>
{ }
public class SubGraphEditWindow : AbstractMaterialGraphEditWindow<SubGraph>
{ }
public abstract class AbstractMaterialGraphEditWindow<TGraphType> : EditorWindow, IMaterialGraphEditWindow where TGraphType : AbstractMaterialGraph
{
public static bool allowAlwaysRepaint = true;
[SerializeField]
Object m_Selected;
[SerializeField]
TGraphType m_InMemoryAsset;
GraphEditorView m_GraphEditorView;
public TGraphType inMemoryAsset
{
get { return m_InMemoryAsset; }
set { m_InMemoryAsset = value; }
}
public Object selected
{
get { return m_Selected; }
set { m_Selected = value; }
}
public MaterialGraphPresenter CreateDataSource()
{
return CreateInstance<MaterialGraphPresenter>();
}
public GraphView CreateGraphView()
{
return new MaterialGraphView(this);
}
void OnEnable()
{
m_GraphEditorView = new GraphEditorView(CreateGraphView());
rootVisualContainer.Add(m_GraphEditorView);
var source = CreateDataSource();
source.Initialize(inMemoryAsset, this);
m_GraphEditorView.presenter = source;
}
void OnDisable()
{
rootVisualContainer.Clear();
}
void OnGUI()
{
var presenter = m_GraphEditorView.presenter;
var e = Event.current;
if (e.type == EventType.ValidateCommand && (
e.commandName == "Copy" && presenter.canCopy
|| e.commandName == "Paste" && presenter.canPaste
|| e.commandName == "Duplicate" && presenter.canDuplicate
|| e.commandName == "Cut" && presenter.canCut
|| (e.commandName == "Delete" || e.commandName == "SoftDelete") && presenter.canDelete))
{
e.Use();
}
if (e.type == EventType.ExecuteCommand)
{
if (e.commandName == "Copy")
presenter.Copy();
if (e.commandName == "Paste")
presenter.Paste();
if (e.commandName == "Duplicate")
presenter.Duplicate();
if (e.commandName == "Cut")
presenter.Cut();
if (e.commandName == "Delete" || e.commandName == "SoftDelete")
presenter.Delete();
}
}
public void PingAsset()
{
if (selected != null)
EditorGUIUtility.PingObject(selected);
}
public void UpdateAsset()
{
if (selected != null && inMemoryAsset != null)
{
var path = AssetDatabase.GetAssetPath(selected);
if (string.IsNullOrEmpty(path) || inMemoryAsset == null)
{
return;
}
if (typeof(TGraphType) == typeof(UnityEngine.MaterialGraph.MaterialGraph))
UpdateShaderGraphOnDisk(path);
if (typeof(TGraphType) == typeof(SubGraph))
UpdateShaderSubGraphOnDisk(path);
}
}
private void UpdateShaderSubGraphOnDisk(string path)
{
var graph = inMemoryAsset as SubGraph;
if (graph == null)
return;
File.WriteAllText(path, EditorJsonUtility.ToJson(inMemoryAsset));
}
private void UpdateShaderGraphOnDisk(string path)
{
var graph = inMemoryAsset as UnityEngine.MaterialGraph.MaterialGraph;
if (graph == null)
return;
var masterNode = graph.masterNode;
if (masterNode == null)
return;
List<PropertyGenerator.TextureInfo> configuredTextures;
masterNode.GetFullShader(GenerationMode.ForReals, "NotNeeded", out configuredTextures);
var shaderImporter = AssetImporter.GetAtPath(path) as ShaderImporter;
if (shaderImporter == null)
return;
var textureNames = new List<string>();
var textures = new List<Texture>();
foreach (var textureInfo in configuredTextures.Where(
x => x.modifiable == TexturePropertyChunk.ModifiableState.Modifiable))
{
var texture = EditorUtility.InstanceIDToObject(textureInfo.textureId) as Texture;
if (texture == null)
continue;
textureNames.Add(textureInfo.name);
textures.Add(texture);
}
shaderImporter.SetDefaultTextures(textureNames.ToArray(), textures.ToArray());
textureNames.Clear();
textures.Clear();
foreach (var textureInfo in configuredTextures.Where(
x => x.modifiable == TexturePropertyChunk.ModifiableState.NonModifiable))
{
var texture = EditorUtility.InstanceIDToObject(textureInfo.textureId) as Texture;
if (texture == null)
continue;
textureNames.Add(textureInfo.name);
textures.Add(texture);
}
shaderImporter.SetNonModifiableTextures(textureNames.ToArray(), textures.ToArray());
File.WriteAllText(path, EditorJsonUtility.ToJson(inMemoryAsset));
shaderImporter.SaveAndReimport();
AssetDatabase.ImportAsset(path);
}
public virtual void ToggleRequiresTime()
{
allowAlwaysRepaint = !allowAlwaysRepaint;
}
public void ChangeSelction(Object newSelection)
{
if (!EditorUtility.IsPersistent(newSelection))
return;
if (selected == newSelection)
return;
if (selected != null)
{
if (EditorUtility.DisplayDialog("Save Old Graph?", "Save Old Graph?", "yes!", "no"))
{
UpdateAsset();
}
}
selected = newSelection;
var path = AssetDatabase.GetAssetPath(newSelection);
var textGraph = File.ReadAllText(path, Encoding.UTF8);
inMemoryAsset = JsonUtility.FromJson<TGraphType>(textGraph);
inMemoryAsset.OnEnable();
inMemoryAsset.ValidateGraph();
var source = CreateDataSource();
source.Initialize(inMemoryAsset, this);
m_GraphEditorView.presenter = source;
//m_GraphView.StretchToParentSize();
Repaint();
/*if (refocus)
{
focused = false;
m_GraphEditorDrawer.graphView.Schedule (Focus).StartingIn (1).Until (() => focused);
}*/
}
}
}

13
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/AbstractMaterialGraphEditWindow.cs.meta


fileFormatVersion: 2
guid: 924ffcbe75518854f97b48776d0f1939
timeCreated: 1503176078
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

42
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderSubGraphImporterEditor.cs


using UnityEditor;
using UnityEditor.Experimental.AssetImporters;
using UnityEditor.MaterialGraph.Drawing;
using UnityEngine;
using Debug = System.Diagnostics.Debug;
[CustomEditor(typeof(ShaderSubGraphImporter))]
public class ShaderSubGraphImporterEditor : ScriptedImporterEditor
{
public override void OnInspectorGUI()
{
if (GUILayout.Button("Open Shader Editor"))
{
AssetImporter importer = target as AssetImporter;
Debug.Assert(importer != null, "importer != null");
ShowGraphEditWindow(importer.assetPath);
}
}
private static void ShowGraphEditWindow(string path)
{
var asset = AssetDatabase.LoadAssetAtPath<Object>(path);
var windows = Resources.FindObjectsOfTypeAll<SubGraphEditWindow>();
bool foundWindow = false;
foreach (var w in windows)
{
if (w.selected == asset)
{
foundWindow = true;
w.Focus();
}
}
if (!foundWindow)
{
var window = CreateInstance<SubGraphEditWindow>();
window.Show();
window.ChangeSelction(asset);
}
}
}

13
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderSubGraphImporterEditor.cs.meta


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

36
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/Graphs/graphs_Cracks.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: graphs_Cracks
m_Shader: {fileID: 4800000, guid: a8cb0d181b460aa4bac2693ce3bfc1ad, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 0
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- Texture2D_Texture2D_CF0DB0B2_Uniform:
m_Texture: {fileID: 2800000, guid: 7296f51323ae9485a9c834c4e3d722ed, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- Texture2D_Texture2D_D8FD66BB_Uniform:
m_Texture: {fileID: 2800000, guid: cbf8f30fb344d2c48b8c6739b327ac7d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- Texture2D_Texture2D_DF8FC6BF_Uniform:
m_Texture: {fileID: 2800000, guid: 9d64a9e7ca6864704ae6b8ca7afc9d85, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- Vector1_Vector1_2852A57B_Uniform: 2.75
m_Colors:
- Color_Color_B59542C3_Uniform: {r: 0, g: 0.201217, b: 0.9411765, a: 0}

10
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/Graphs/graphs_Cracks.mat.meta


fileFormatVersion: 2
guid: 368cc6243361aa043933e1fc5a83edbf
timeCreated: 1503176184
licenseType: Pro
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

12
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphEditWindow.cs.meta


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

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


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using UnityEditor.Experimental.UIElements.GraphView;
using UnityEngine;
using UnityEngine.Graphing;
using UnityEngine.MaterialGraph;
using Object = UnityEngine.Object;
namespace UnityEditor.MaterialGraph.Drawing
{
public class MaterialGraphEditWindow : EditorWindow, ISerializationCallbackReceiver
{
public static bool allowAlwaysRepaint = true;
bool shouldRepaint
{
get { return allowAlwaysRepaint && inMemoryAsset != null && inMemoryAsset.shouldRepaint; }
}
[SerializeField]
Object m_Selected;
[SerializeField]
MaterialGraphAsset m_InMemoryAsset;
GraphEditorView m_GraphEditorView;
public IGraphAsset inMemoryAsset
{
get { return m_InMemoryAsset; }
set { m_InMemoryAsset = value as MaterialGraphAsset; }
}
public Object selected
{
get { return m_Selected; }
set { m_Selected = value; }
}
public MaterialGraphPresenter CreateDataSource()
{
return CreateInstance<MaterialGraphPresenter>();
}
public GraphView CreateGraphView()
{
return new MaterialGraphView(this);
}
void OnEnable()
{
m_GraphEditorView = new GraphEditorView(CreateGraphView());
rootVisualContainer.Add(m_GraphEditorView);
var source = CreateDataSource();
source.Initialize(inMemoryAsset, this);
m_GraphEditorView.presenter = source;
}
void OnDisable()
{
rootVisualContainer.Clear();
}
void Update()
{
if (shouldRepaint)
Repaint();
}
void OnGUI()
{
var presenter = m_GraphEditorView.presenter;
var e = Event.current;
if (e.type == EventType.ValidateCommand && (
e.commandName == "Copy" && presenter.canCopy
|| e.commandName == "Paste" && presenter.canPaste
|| e.commandName == "Duplicate" && presenter.canDuplicate
|| e.commandName == "Cut" && presenter.canCut
|| (e.commandName == "Delete" || e.commandName == "SoftDelete") && presenter.canDelete))
{
e.Use();
}
if (e.type == EventType.ExecuteCommand)
{
if (e.commandName == "Copy")
presenter.Copy();
if (e.commandName == "Paste")
presenter.Paste();
if (e.commandName == "Duplicate")
presenter.Duplicate();
if (e.commandName == "Cut")
presenter.Cut();
if (e.commandName == "Delete" || e.commandName == "SoftDelete")
presenter.Delete();
}
}
public void PingAsset()
{
if (selected != null)
EditorGUIUtility.PingObject(selected);
}
public void UpdateAsset()
{
if (selected != null && inMemoryAsset != null)
{
var path = AssetDatabase.GetAssetPath(selected);
if (string.IsNullOrEmpty(path) || inMemoryAsset == null)
{
return;
}
var masterNode = ((MaterialGraphAsset)inMemoryAsset).materialGraph.masterNode;
if (masterNode == null)
return;
List<PropertyGenerator.TextureInfo> configuredTextures;
masterNode.GetFullShader(GenerationMode.ForReals, "NotNeeded", out configuredTextures);
var shaderImporter = AssetImporter.GetAtPath(path) as ShaderImporter;
if (shaderImporter == null)
return;
var textureNames = new List<string>();
var textures = new List<Texture>();
foreach (var textureInfo in configuredTextures.Where(
x => x.modifiable == TexturePropertyChunk.ModifiableState.Modifiable))
{
var texture = EditorUtility.InstanceIDToObject(textureInfo.textureId) as Texture;
if (texture == null)
continue;
textureNames.Add(textureInfo.name);
textures.Add(texture);
}
shaderImporter.SetDefaultTextures(textureNames.ToArray(), textures.ToArray());
textureNames.Clear();
textures.Clear();
foreach (var textureInfo in configuredTextures.Where(
x => x.modifiable == TexturePropertyChunk.ModifiableState.NonModifiable))
{
var texture = EditorUtility.InstanceIDToObject(textureInfo.textureId) as Texture;
if (texture == null)
continue;
textureNames.Add(textureInfo.name);
textures.Add(texture);
}
shaderImporter.SetNonModifiableTextures(textureNames.ToArray(), textures.ToArray());
File.WriteAllText(path, EditorJsonUtility.ToJson(inMemoryAsset.graph));
shaderImporter.SaveAndReimport();
AssetDatabase.ImportAsset(path);
}
}
public virtual void ToggleRequiresTime()
{
allowAlwaysRepaint = !allowAlwaysRepaint;
}
public void ChangeSelction(Object newSelection)
{
if (!EditorUtility.IsPersistent(newSelection))
return;
if (selected == newSelection)
return;
if (selected != null)
{
if (EditorUtility.DisplayDialog("Save Old Graph?", "Save Old Graph?", "yes!", "no"))
{
UpdateAsset();
}
}
selected = newSelection;
var mGraph = CreateInstance<MaterialGraphAsset>();
var path = AssetDatabase.GetAssetPath(newSelection);
var textGraph = File.ReadAllText(path, Encoding.UTF8);
mGraph.materialGraph = JsonUtility.FromJson<UnityEngine.MaterialGraph.MaterialGraph>(textGraph);
inMemoryAsset = mGraph;
var graph = inMemoryAsset.graph;
graph.OnEnable();
graph.ValidateGraph();
var source = CreateDataSource();
source.Initialize(inMemoryAsset, this);
m_GraphEditorView.presenter = source;
//m_GraphView.StretchToParentSize();
Repaint();
/*if (refocus)
{
focused = false;
m_GraphEditorDrawer.graphView.Schedule (Focus).StartingIn (1).Until (() => focused);
}*/
}
public void OnBeforeSerialize() { }
public void OnAfterDeserialize() { }
}
}

71
MaterialGraphProject/UnityProject.sln.DotSettings


<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/ExcludedFiles/FileMasksToSkip/=_002A_002Emin_002Ejs/@EntryIndexedValue">True</s:Boolean>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ParameterHidesMember/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=TestCleanup/@EntryIndexedValue">&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;Profile name="TestCleanup"&gt;&lt;CSUseVar&gt;&lt;BehavourStyle&gt;CAN_CHANGE_TO_IMPLICIT&lt;/BehavourStyle&gt;&lt;LocalVariableStyle&gt;IMPLICIT_WHEN_INITIALIZER_HAS_TYPE&lt;/LocalVariableStyle&gt;&lt;ForeachVariableStyle&gt;IMPLICIT_EXCEPT_PRIMITIVE_TYPES&lt;/ForeachVariableStyle&gt;&lt;/CSUseVar&gt;&lt;CSReformatCode&gt;True&lt;/CSReformatCode&gt;&lt;CSShortenReferences&gt;True&lt;/CSShortenReferences&gt;&lt;CSReorderTypeMembers&gt;True&lt;/CSReorderTypeMembers&gt;&lt;/Profile&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/CodeCleanup/SilentCleanupProfile/@EntryValue">TestCleanup</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CommonFormatter/ALIGNMENT_TAB_FILL_STYLE/@EntryValue">USE_TABS_ONLY</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_FIRST_ARG_BY_PAREN/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALLOW_COMMENT_AFTER_LBRACE/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_FIXED_BRACES_STYLE/@EntryValue">ONLY_FOR_MULTILINE</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_FOR_BRACES_STYLE/@EntryValue">ONLY_FOR_MULTILINE</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_FOREACH_BRACES_STYLE/@EntryValue">ONLY_FOR_MULTILINE</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_IFELSE_BRACES_STYLE/@EntryValue">ONLY_FOR_MULTILINE</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_USING_BRACES_STYLE/@EntryValue">ONLY_FOR_MULTILINE</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_WHILE_BRACES_STYLE/@EntryValue">ONLY_FOR_MULTILINE</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/LINE_FEED_AT_FILE_END/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AROUND_MULTIPLICATIVE_OP/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/STICK_COMMENT/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_AFTER_DECLARATION_LPAR/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_AFTER_INVOCATION_LPAR/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_ARGUMENTS_STYLE/@EntryValue">CHOP_IF_LONG</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LINES/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_OBJECT_AND_COLLECTION_INITIALIZER_STYLE/@EntryValue">WRAP_IF_LONG</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_PARAMETERS_STYLE/@EntryValue">CHOP_IF_LONG</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_TERNARY_EXPR_STYLE/@EntryValue">WRAP_IF_LONG</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IOS/@EntryIndexedValue">IOS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=JSON/@EntryIndexedValue">JSON</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=URL/@EntryIndexedValue">URL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=WWW/@EntryIndexedValue">WWW</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/EventHandlerPatternLong/@EntryValue">$object$_On$event$</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Constants/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="k" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=EnumMember/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Interfaces/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="I" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=LocalConstants/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Locals/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=MethodPropertyEvent/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Other/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=Parameters/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateConstants/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="k" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="m_" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="s_" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="s_" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PublicFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=StaticReadonly/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="s_" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=TypeParameters/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=TypesAndNamespaces/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=322f0158_002D32f7_002D4dbd_002D8074_002D5bab8e115868/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Instance" AccessRightKinds="Private, Protected, ProtectedInternal, Internal" Description="Instance fields use m_UpperCamelCase"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="m_" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=61e4c291_002D6082_002D499a_002Dbca0_002D2998e9a033b0/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static" AccessRightKinds="Private, Protected, ProtectedInternal, Internal" Description="Static fields use s_UpperCamelCase"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="s_" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=62b83c0d_002D2de0_002D469b_002D8d70_002Db987142b7fcb/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static, Instance" AccessRightKinds="Private, Protected, ProtectedInternal, Internal, Public" Description="Properties use lowerCamelCase"&gt;&lt;ElementKinds&gt;&lt;Kind Name="PROPERTY" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=d746427c_002Daa4b_002D47f5_002D86f2_002Dd092c7b63ab9/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static, Instance" AccessRightKinds="Private, Protected, ProtectedInternal, Internal" Description=""&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="m_" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=e94c94df_002Dfc74_002D4278_002Da29b_002Dc332cc76b12c/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static, Instance" AccessRightKinds="Public" Description=""&gt;&lt;ElementKinds&gt;&lt;Kind Name="PROPERTY" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=eb7ed005_002D0654_002D43ef_002D8eac_002D79c84dc5ab3a/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static, Instance" AccessRightKinds="Public" Description="Public constants use UpperCamelCase"&gt;&lt;ElementKinds&gt;&lt;Kind Name="CONSTANT_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/EventHandlerPatternLong/@EntryValue">$object$_On$event$</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/PredefinedNamingRules/=Constants/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb"&gt;&lt;ExtraRule Prefix="k" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/PredefinedNamingRules/=EnumMember/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/PredefinedNamingRules/=Interfaces/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="I" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/PredefinedNamingRules/=LocalConstants/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/PredefinedNamingRules/=Locals/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/PredefinedNamingRules/=MethodPropertyEvent/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/PredefinedNamingRules/=Other/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/PredefinedNamingRules/=Parameters/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/PredefinedNamingRules/=PrivateConstants/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="k" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="m_" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="s_" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/PredefinedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="k" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/PredefinedNamingRules/=PublicFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb"&gt;&lt;ExtraRule Prefix="m_" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/PredefinedNamingRules/=StaticReadonly/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="s_" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/PredefinedNamingRules/=TypeParameters/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/VBNaming/PredefinedNamingRules/=TypesAndNamespaces/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

2
MaterialGraphProject/MaterialGraphProject.CSharp.Editor.csproj.DotSettings


<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp40</s:String></wpf:ResourceDictionary>

2
MaterialGraphProject/MaterialGraphProject.CSharp.csproj.DotSettings


<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp40</s:String></wpf:ResourceDictionary>

15
MaterialGraphProject/MaterialGraphProject.sln.DotSettings.user


<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/Environment/ContinuousTesting/PersistentDataLocation/@EntryValue">C:\Users\Tim\AppData\Local\Temp\JetBrains\ContinuousTesting\7e95cb10-f230-442a-ba1f-a26bdb4193cb</s:String>
<s:String x:Key="/Default/Environment/ContinuousTesting/ScopeCriterion/@EntryValue">9b0nIQIAAACJbLoh9b0nIQIAAADP4jFoJAAAADwATQBhAHQAZQByAGkAYQBsAEcAcgBhAHAAaABQAHIAbwBqAGUAYwB0AC4AQwBTAGgAYQByAHAALgBFAGQAaQB0AG8AcgA+AC0AAABDADoAXABjAG8AZABlAFwATQBhAHQAZQByAGkAYQBsAEcAcgBhAHAAaABHAGkAdABcAE0AYQB0AGUAcgBpAGEAbABHAHIAYQBwAGgAUAByAG8AagBlAGMAdAA4rDtD+4tkDSUAAABVAG4AaQB0AHkARQBkAGkAdABvAHIALgBHAHIAYQBwAGgAaQBuAGcALgBJAG4AdABlAGcAcgBhAHQAaQBvAG4AVABlAHMAdABzAA==</s:String>
<s:String x:Key="/Default/Environment/ContinuousTesting/SnapshotLocation/@EntryValue">C:\Users\tim\AppData\Local\Temp\ssm.Metecyz.tmp</s:String>
<s:String x:Key="/Default/Environment/ContinuousTesting/Strategy/@EntryValue">RunTests</s:String>
<s:String x:Key="/Default/Environment/ContinuousTesting/TriggerMode/@EntryValue">OnBuild</s:String></wpf:ResourceDictionary>
正在加载...
取消
保存