예제 #1
0
        public UniExposedParameterFieldView(UniGraphAsset graphView, IUniExposedParameter param, Action <IUniExposedParameter> removeAction)
            : base(null, param.DisplayName, string.Empty)
        {
            this.graphView = graphView;
            _removeAction  = removeAction;
            parameter      = param;
            this.AddManipulator(new ContextualMenuManipulator(BuildContextualMenu));
            this.Q("icon").AddToClassList("parameter-" + param.Info);
            this.Q("icon").visible = true;

            (this.Q("textField") as TextField).RegisterValueChangedCallback((e) => {
                param.DisplayName = e.newValue;
                text = e.newValue;
            });

            var addButton = new Button(ApplyParameter);

            addButton.text = "+";
            Add(addButton);
        }
 protected void Remove(IUniExposedParameter parameter)
 {
     graphAsset.uniExposedParameters.Remove(parameter);
     UpdateParameterList();
 }
예제 #3
0
 public UniExposedParameterPropertyView(BaseGraphView graphView, IUniExposedParameter param)
 {
     baseGraphView = graphView;
     parameter     = param;
 }