コード例 #1
0
        public static VisualElement GetElementOfVector4Field(Vector4 startValue, string fieldName, Action <object> setValue, Action <object> getValue)
        {
            Vector4Field field = new Vector4Field(fieldName);

            field.SetValueWithoutNotify(startValue);
            field.RegisterValueChangedCallback(s => setValue.Invoke(s.newValue));
            getValue += o => field.SetValueWithoutNotify((Vector4)o);
            return(field);
        }
コード例 #2
0
        public static void RenderVector4Property(VisualElement container, string name, object value,
                                                 Action <object> setter)
        {
            var field = new Vector4Field(name);

            field.SetValueWithoutNotify((Vector4)value);
            field.MarkDirtyRepaint();
            field.RegisterValueChangedCallback(evt => setter(evt.newValue));
            container.Add(field);
        }
コード例 #3
0
 public void Update(InspectorDataProxy <float4> proxy)
 {
     m_VectorField.SetValueWithoutNotify(proxy.Data);
 }