コード例 #1
0
        public static IGraphElement CreateEdgePortal(this ElementBuilder elementBuilder, IStore store, IEdgePortalModel model)
        {
            var ui = new Token();

            ui.Setup(model, store, elementBuilder.GraphView);
            return(ui);
        }
コード例 #2
0
        public static IGraphElement CreateToken(this ElementBuilder elementBuilder, IStore store, SystemConstantNodeModel model)
        {
            var ui = new Token();

            ui.Setup(model, store, elementBuilder.GraphView);
            return(ui);
        }
コード例 #3
0
        public static IGraphElement CreateToken(this ElementBuilder elementBuilder, IStore store, IVariableModel model)
        {
            var       isExposed = model.DeclarationModel?.IsExposed;
            Texture2D icon      = (isExposed != null && isExposed.Value)
                ? GraphViewStaticBridge.LoadIconRequired("GraphView/Nodes/BlackboardFieldExposed.png")
                : null;

            var ui = new Token();

            ui.Setup(model, store, elementBuilder.GraphView, icon);
            return(ui);
        }
        public static IGraphElement CreateSetVar(this ElementBuilder elementBuilder, IStore store, SetVariableNodeModel model)
        {
            if (model.DeclarationModel.IsObjectReference())
            {
                return(elementBuilder.CreateToken(store, model));
            }

            if (!model.IsGetter)
            {
                var ui = new SetVariableNode();
                ui.AddToClassList(Unity.Modifier.GraphElements.Node.k_UssClassName + "--setvar-node");
                ui.Setup(model, store, elementBuilder.GraphView);
                return(ui);
            }

            var token = new Token();

            token.AddToClassList("dots-variable-token");
            token.Setup(model, store, elementBuilder.GraphView);
            return(token);
        }