public override bool IsValid(ActionGraphView graphView, NodeCollection nodes) { var roots = nodes.Where(node => node.root).ToList(); if (roots.Count <= 1) { return(true); } else { foreach (var root in roots) { graphView.GetNodeByGuid(root.guid).AddError("Graph must have 1 root node."); } return(false); } }
public Inspector(ActionGraphView graphView) { this.graphView = graphView; rootElement = AssetDatabase.LoadAssetAtPath <VisualTreeAsset>(Uxml).CloneTree(); this.style.paddingBottom = this.style.paddingLeft = this.style.paddingRight = this.style.paddingTop = 0; variableContainer = rootElement.Q <VisualElement>("variables"); propertyContainer = rootElement.Q <VisualElement>("properties"); this.Add(rootElement); this.capabilities = Capabilities.Collapsible | Capabilities.Movable | Capabilities.Resizable; this.SetPosition(new Rect(0, 0, 240, 320)); this.AddManipulator(new Dragger { clampToParentEdges = true }); var resizer = new Resizer(); this.Add(resizer); }
public abstract bool IsValid(ActionGraphView graphView, NodeCollection nodes);
public override GraphElement CreateNode(ActionGraphView graphView, ActionGraphGlobalSettings settings, Rect layout, string guid = null) => data.CreateNode(graphView, settings, layout, guid);
public abstract GraphElement CreateNode(ActionGraphView graphView, ActionGraphGlobalSettings settings, Rect layout, string guid = null);