Пример #1
0
        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);
            }
        }
Пример #2
0
        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);
        }
Пример #3
0
 public abstract bool IsValid(ActionGraphView graphView, NodeCollection nodes);
Пример #4
0
 public override GraphElement CreateNode(ActionGraphView graphView, ActionGraphGlobalSettings settings, Rect layout, string guid = null) => data.CreateNode(graphView, settings, layout, guid);
Пример #5
0
 public abstract GraphElement CreateNode(ActionGraphView graphView, ActionGraphGlobalSettings settings, Rect layout, string guid = null);