浏览代码

#35 Move a bunch of files from SerializableGraph folder to MaterialGraph folder (and delete a few unused ones)

/main
Peter Bay Bastian 7 年前
当前提交
f2510f42
共有 50 个文件被更改,包括 72 次插入123 次删除
  1. 1
      MaterialGraphProject/Assets/GraphFramework.meta
  2. 1
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor.meta
  3. 1
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Resources.meta
  4. 9
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphView.cs
  5. 14
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Resources/Styles/MaterialGraph.uss
  6. 2
      MaterialGraphProject/ProjectSettings/ProjectVersion.txt
  7. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Drawer/GraphEditorDrawer.cs
  8. 3
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Manipulators.meta
  9. 47
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Manipulators/Clicker.cs
  10. 17
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/GUIModificationType.cs
  11. 9
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing.meta
  12. 12
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/GUIModificationType.cs.meta
  13. 12
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Util/EnumerableExtensions.cs.meta
  14. 12
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Util/ValueTuple.cs.meta
  15. 25
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Util/EnumerableExtensions.cs
  16. 28
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Util/ValueTuple.cs
  17. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Util
  18. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Util.meta
  19. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Resources/Styles/TitleBar.uss
  20. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Resources/Styles/TitleBar.uss.meta
  21. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/AbstractGraphInspector.cs.meta
  22. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/NodeInspectors/AbstractNodeInspector.cs.meta
  23. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/NodeInspectors/BasicNodeInspector.cs.meta
  24. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/NodeInspectors/AbstractNodeInspector.cs
  25. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/NodeInspectors/BasicNodeInspector.cs
  26. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/AbstractGraphInspector.cs
  27. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Drawer/TitleBarDrawer.cs.meta
  28. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Drawer/TitleBarButtonDrawer.cs.meta
  29. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Drawer/GraphEditorDrawer.cs.meta
  30. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Drawer/TitleBarButtonDrawer.cs
  31. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Drawer/TitleBarDrawer.cs
  32. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Drawer/GraphEditorDrawer.cs
  33. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Manipulators/Clicker.cs.meta
  34. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Manipulators/Commandable.cs.meta
  35. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Manipulators/Commandable.cs
  36. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GraphEdgePresenter.cs
  37. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GraphNodePresenter.cs
  38. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/TitleBarButtonPresenter.cs
  39. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GraphAnchorPresenter.cs.meta
  40. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GraphControlPresenter.cs.meta
  41. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GraphEdgePresenter.cs.meta
  42. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GraphNodePresenter.cs.meta
  43. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/TitleBarButtonPresenter.cs.meta
  44. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/TitleBarPresenter.cs.meta
  45. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GraphAnchorPresenter.cs
  46. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GraphControlPresenter.cs
  47. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/TitleBarPresenter.cs

1
MaterialGraphProject/Assets/GraphFramework.meta


timeCreated: 1445418016
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor.meta


timeCreated: 1464264920
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Resources.meta


timeCreated: 1485544540
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

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


{ "Copy", () => true, () => Debug.Log("Copy!") }
});
this.AddManipulator(new ClickGlobalSelector());
this.AddManipulator(new ContentZoomer());
this.AddManipulator(new ContentDragger());
this.AddManipulator(new RectangleSelector());

Insert(0, new GridBackground());
typeFactory[typeof(GraphNodePresenter)] = typeof(NodeDrawer);
RegisterCallback<MouseUpEvent>(DoContextMenu);

return;
var graphAsset = graphDataSource.graphAsset;
if (graphAsset == null || graphAsset.drawingData.selection.SequenceEqual(selection.OfType<NodeDrawer>().Select(d => ((GraphNodePresenter) d.presenter).node.guid))) return;
if (graphAsset == null || graphAsset.drawingData.selection.SequenceEqual(selection.OfType<MaterialNodeDrawer>().Select(d => ((GraphNodePresenter) d.presenter).node.guid))) return;
.OfType<NodeDrawer>()
.OfType<MaterialNodeDrawer>()
.FirstOrDefault(drawer => ((GraphNodePresenter) drawer.presenter).node.guid == guid))
.ToList();

if (graphDataSource == null || graphDataSource.graphAsset == null)
return;
var selectedNodeGuids = selection.OfType<NodeDrawer>().Select(x => ((GraphNodePresenter) x.presenter).node.guid);
var selectedNodeGuids = selection.OfType<MaterialNodeDrawer>().Select(x => ((GraphNodePresenter) x.presenter).node.guid);
graphDataSource.graphAsset.drawingData.selection = selectedNodeGuids;
}

14
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Resources/Styles/MaterialGraph.uss


GraphEditorDrawer {
flex-direction: column;
background: #f00;
flex: 1;
}
GraphEditorDrawer #TitleBar {
}
GraphEditorDrawer #GraphView {
flex: 1;
}
.MaterialNode #preview {
height: 200;
width: 200;

2
MaterialGraphProject/ProjectSettings/ProjectVersion.txt


m_EditorVersion: 2017.3.0a2
m_EditorVersion: 2017.3.0a4

2
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Drawer/GraphEditorDrawer.cs


// TODO: Create graphView from here rather than have it passed in through constructor
public GraphEditorDrawer(GraphView graphView)
{
AddStyleSheetPath("Styles/GraphEditor");
AddStyleSheetPath("Styles/MaterialGraph");
m_GraphView = graphView;
m_GraphView.name = "GraphView";

3
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Manipulators.meta


fileFormatVersion: 2
guid: abc41fae76b14617ae2f7d38d3ebef3a
timeCreated: 1502866309

47
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Manipulators/Clicker.cs


using UnityEngine.Experimental.UIElements;
using MouseManipulator = UnityEngine.Experimental.UIElements.MouseManipulator;
using ManipulatorActivationFilter = UnityEngine.Experimental.UIElements.ManipulatorActivationFilter;
using MouseButton = UnityEngine.Experimental.UIElements.MouseButton;
namespace UnityEditor.Graphing.Drawing
{
public enum ClickerState
{
Inactive,
Active
}
// TODO JOCE: This is to mimic the behavior of a button. Remove and replace with actual button in TitleBar.
public class Clicker : MouseManipulator
{
public delegate void StateChangeCallback(ClickerState newState);
public delegate void ClickCallback();
public StateChangeCallback onStateChange { get; set; }
public ClickCallback onClick { get; set; }
VisualElement initialTarget;
ClickerState state;
public Clicker()
{
activators.Add(new ManipulatorActivationFilter {button = MouseButton.LeftMouse});
}
protected override void RegisterCallbacksOnTarget()
{
target.RegisterCallback<MouseUpEvent>(OnMouseUp, Capture.Capture);
}
protected override void UnregisterCallbacksFromTarget()
{
target.UnregisterCallback<MouseUpEvent>(OnMouseUp, Capture.Capture);
}
void OnMouseUp(MouseUpEvent evt)
{
onClick();
}
}
}

17
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/GUIModificationType.cs


using System;
namespace UnityEditor.Graphing
{
[Flags]
public enum GUIModificationType
{
None = 0,
// just repaint this node and it's dependencies
Repaint = 1 << 0,
// something structurally changed, rebuild the graph from scratch!
ModelChanged = 1 << 1,
// some data internally to the node was modified
// that dependent nodes may use.
DataChanged = 1 << 2
}
}

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


fileFormatVersion: 2
guid: 1dc52c222e72d364ba1f1ce5d428d645
folderAsset: yes
timeCreated: 1464264920
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

12
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/GUIModificationType.cs.meta


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

12
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Util/EnumerableExtensions.cs.meta


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

12
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Util/ValueTuple.cs.meta


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

25
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Util/EnumerableExtensions.cs


using System;
using System.Collections;
using System.Collections.Generic;
namespace UnityEditor.Graphing.Util
{
public static class EnumerableExtensions
{
public static IEnumerable<TResult> Zip<TFirst, TSecond, TResult>(this IEnumerable<TFirst> first, IEnumerable<TSecond> second, Func<TFirst, TSecond, TResult> resultSelector)
{
var e1 = first.GetEnumerator();
var e2 = second.GetEnumerator();
while (e1.MoveNext() && e2.MoveNext())
{
yield return resultSelector(e1.Current, e2.Current);
}
}
public static IEnumerable<ValueTuple<TFirst, TSecond>> Zip<TFirst, TSecond>(this IEnumerable<TFirst> first, IEnumerable<TSecond> second)
{
return first.Zip(second, ValueTuple.Create);
}
}
}

28
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Util/ValueTuple.cs


using System;
namespace UnityEditor.Graphing.Util
{
public struct ValueTuple<T1, T2>
{
public T1 Item1 { get; set; }
public T2 Item2 { get; set; }
public ValueTuple(T1 item1, T2 item2)
{
Item1 = item1;
Item2 = item2;
}
public static ValueTuple<T1, T2> Create(T1 item1, T2 item2)
{
return new ValueTuple<T1, T2>(item1, item2);
}
}
public static class ValueTuple
{
public static ValueTuple<T1, T2> Create<T1, T2>(T1 item1, T2 item2)
{
return new ValueTuple<T1, T2>(item1, item2);
}
}
}

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Util → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Util

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Util.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Util.meta

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Resources/Styles/TitleBar.uss → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Resources/Styles/TitleBar.uss

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Resources/Styles/TitleBar.uss.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Resources/Styles/TitleBar.uss.meta

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/AbstractGraphInspector.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/AbstractGraphInspector.cs.meta

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/NodeInspectors/AbstractNodeInspector.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/NodeInspectors/AbstractNodeInspector.cs.meta

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/NodeInspectors/BasicNodeInspector.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/NodeInspectors/BasicNodeInspector.cs.meta

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/NodeInspectors/AbstractNodeInspector.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/NodeInspectors/AbstractNodeInspector.cs

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/NodeInspectors/BasicNodeInspector.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/NodeInspectors/BasicNodeInspector.cs

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/AbstractGraphInspector.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/AbstractGraphInspector.cs

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Drawer/TitleBarDrawer.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Drawer/TitleBarDrawer.cs.meta

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Drawer/TitleBarButtonDrawer.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Drawer/TitleBarButtonDrawer.cs.meta

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Drawer/GraphEditorDrawer.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Drawer/GraphEditorDrawer.cs.meta

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Drawer/TitleBarButtonDrawer.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Drawer/TitleBarButtonDrawer.cs

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Drawer/TitleBarDrawer.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Drawer/TitleBarDrawer.cs

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Drawer/GraphEditorDrawer.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Drawer/GraphEditorDrawer.cs

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Manipulators/Clicker.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Manipulators/Clicker.cs.meta

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Manipulators/Commandable.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Manipulators/Commandable.cs.meta

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Manipulators/Commandable.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Manipulators/Commandable.cs

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Presenters/GraphEdgePresenter.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GraphEdgePresenter.cs

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Presenters/GraphNodePresenter.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GraphNodePresenter.cs

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Presenters/TitleBarButtonPresenter.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/TitleBarButtonPresenter.cs

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Presenters/GraphAnchorPresenter.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GraphAnchorPresenter.cs.meta

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Presenters/GraphControlPresenter.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GraphControlPresenter.cs.meta

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Presenters/GraphEdgePresenter.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GraphEdgePresenter.cs.meta

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Presenters/GraphNodePresenter.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GraphNodePresenter.cs.meta

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Presenters/TitleBarButtonPresenter.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/TitleBarButtonPresenter.cs.meta

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Presenters/TitleBarPresenter.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/TitleBarPresenter.cs.meta

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Presenters/GraphAnchorPresenter.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GraphAnchorPresenter.cs

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Presenters/GraphControlPresenter.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GraphControlPresenter.cs

/MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/Presenters/TitleBarPresenter.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/TitleBarPresenter.cs

正在加载...
取消
保存