timeCreated: 1445418016
licenseType: Pro
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
timeCreated: 1464264920
timeCreated: 1485544540
{ "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)
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;
}
GraphEditorDrawer {
flex-direction: column;
background: #f00;
flex: 1;
GraphEditorDrawer #TitleBar {
GraphEditorDrawer #GraphView {
.MaterialNode #preview {
height: 200;
width: 200;
m_EditorVersion: 2017.3.0a2
m_EditorVersion: 2017.3.0a4
// 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";
fileFormatVersion: 2
guid: abc41fae76b14617ae2f7d38d3ebef3a
timeCreated: 1502866309
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();
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
fileFormatVersion: 2
guid: 1dc52c222e72d364ba1f1ce5d428d645
folderAsset: yes
guid: eda3c0504bf73e244befc23f40505007
timeCreated: 1464264926
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
guid: 3042c033e57ba45458680f0259feca30
timeCreated: 1481279276
guid: 7fdb7b91a165649ba9e20ceaea67a970
timeCreated: 1481279988
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);
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)