ToneCurveNode() : base() { title = "Tone Curve"; AddInputPort <Vector4>("Color"); AddOutputPort <Vector4>("Color"); RefreshPorts(); m_RCurveField = new CurveField() { ranges = new Rect(0f, 0f, 1f, 1f) }; m_GCurveField = new CurveField() { ranges = new Rect(0f, 0f, 1f, 1f) }; m_BCurveField = new CurveField() { ranges = new Rect(0f, 0f, 1f, 1f) }; m_ACurveField = new CurveField() { ranges = new Rect(0f, 0f, 1f, 1f) }; m_GCurveField.SetEnabled(false); m_BCurveField.SetEnabled(false); m_RCurveField.OnValueChanged(e => m_GCurveField.value = e.newValue); m_RCurveField.OnValueChanged(e => m_BCurveField.value = e.newValue); extensionContainer.Add(m_RCurveField); extensionContainer.Add(m_GCurveField); extensionContainer.Add(m_BCurveField); extensionContainer.Add(m_ACurveField); RefreshExpandedState(); }
public static void RenderCurveProperty(VisualElement container, string name, object value, Action <object> setter) { var field = new CurveField(name); field.SetValueWithoutNotify((AnimationCurve)value); field.MarkDirtyRepaint(); field.RegisterValueChangedCallback(evt => setter(evt.newValue)); container.Add(field); }
void Init() { CurveField field = new CurveField() { value = config.value != null ? (AnimationCurve)config.value : new AnimationCurve(), }; field.RegisterCallback <ChangeEvent <AnimationCurve> >(evt => { config.OnValueChanged(evt.newValue); MarkDirtyRepaint(); }); Add(field); }
private void DrawFields(ScorerData scData, List <string> keys) { CurveField curveField = new CurveField("uFunction"); int index = keys.IndexOf(scData.key); PopupField <string> popupField = new PopupField <string>("key", keys, index); /*UnityExtensions.DebugLogEnumerable(popupField.GetClasses()); * UnityExtensions.DebugLogEnumerable(curveField.GetClasses());*/ curveField.BindProperty(serData.FindPropertyRelative("uFunction")); popupField.BindProperty(serData.FindPropertyRelative("key")); contentContainer.Add(curveField); contentContainer.Add(popupField); }
protected void Init() { AddToClassList(USS_CLASS_NAME); AddToClassList("worldStateItem"); AddToClassList("rounded"); m_WorldStateField = new TextField("World State") { value = m_UtilityDescription.WorldStateName }; m_WorldStateField.tooltip = "The identifier of the world state. The corresponding world state value should be castable to float."; m_WorldStateField.maxLength = 30; hierarchy.Add(m_WorldStateField); m_OperatorSelectorField = new UtilityOperatorSelectorField("Operator") { value = m_UtilityDescription.UtilityOperator }; m_OperatorSelectorField.tooltip = "Defines how the resulting value will be applied to the base utility value. All curves will be applied in order of appearance."; hierarchy.Add(m_OperatorSelectorField); m_CurveField = new CurveField("Curve") { value = m_UtilityDescription.UtilityCurve }; m_CurveField.tooltip = "The curve that will be evaluated based on the world state. world state will be interpreted as a float."; hierarchy.Add(m_CurveField); m_CurveMultiplierField = new FloatField("Curve Multiplier") { value = m_UtilityDescription.CurveMultiplier }; m_CurveMultiplierField.tooltip = "The evaluated curve value will be multiplied with this number before it is applied to the base utility value."; hierarchy.Add(m_CurveMultiplierField); m_WorldStateField.RegisterValueChangedCallback(WorldStateNameChanged); m_OperatorSelectorField.RegisterValueChangedCallback(UtilityOperatorChanged); m_CurveField.RegisterValueChangedCallback(CurveChanged); m_CurveMultiplierField.RegisterValueChangedCallback(CurveMultiplierChanged); this.AddManipulator(new Clickable(() => OnMouseDown?.Invoke(this))); this.AddManipulator(new ContextualMenuManipulator(_menubuilder => { _menubuilder.menu.AppendAction("Delete", _dropDownMenuAction => OnDelete?.Invoke(this), DropdownMenuAction.Status.Normal); _menubuilder.menu.AppendAction("Duplicate", _dropDownMenuAction => OnDuplicate?.Invoke(this), DropdownMenuAction.Status.Normal); })); }
protected void Init() { AddToClassList(USS_CLASS_NAME); AddToClassList("worldStateItem"); AddToClassList("rounded"); m_WorldStateField = new TextField("World State") { value = m_UtilityDescription.WorldStateName }; m_WorldStateField.maxLength = 30; hierarchy.Add(m_WorldStateField); m_OperatorSelectorField = new UtilityOperatorSelectorField("Operator") { value = m_UtilityDescription.UtilityOperator }; hierarchy.Add(m_OperatorSelectorField); m_CurveField = new CurveField("Curve") { value = m_UtilityDescription.UtilityCurve }; hierarchy.Add(m_CurveField); m_CurveMultiplierField = new FloatField("Curve Multiplier") { value = m_UtilityDescription.CurveMultiplier }; hierarchy.Add(m_CurveMultiplierField); m_WorldStateField.RegisterValueChangedCallback(WorldStateNameChanged); m_OperatorSelectorField.RegisterValueChangedCallback(UtilityOperatorChanged); m_CurveField.RegisterValueChangedCallback(CurveChanged); m_CurveMultiplierField.RegisterValueChangedCallback(CurveMultiplierChanged); this.AddManipulator(new Clickable(() => OnMouseDown?.Invoke(this))); this.AddManipulator(new ContextualMenuManipulator(_menubuilder => { _menubuilder.menu.AppendAction("Delete", _dropDownMenuAction => OnDelete?.Invoke(this), DropdownMenuAction.Status.Normal); _menubuilder.menu.AppendAction("Duplicate", _dropDownMenuAction => OnDuplicate?.Invoke(this), DropdownMenuAction.Status.Normal); })); }
CurveField CreateCurveField(Func <AnimationCurve> getter, Action <AnimationCurve> setter) { var curveField = new CurveField() { value = getter(), renderMode = CurveField.RenderMode.Mesh, }; curveField.style.height = 128; curveField.RegisterValueChangedCallback(e => { owner.RegisterCompleteObjectUndo("Updated Curve"); setter((AnimationCurve)e.newValue); curveNode.UpdateTexture(); NotifyNodeChanged(); }); return(curveField); }
public override void Enable() { base.Enable(); curveNode = nodeTarget as CurveNode; var gradientField = new CurveField() { value = curveNode.curve }; gradientField.style.height = 128; gradientField.RegisterValueChangedCallback(e => { owner.RegisterCompleteObjectUndo("Updated Curve"); curveNode.curve = (AnimationCurve)e.newValue; NotifyNodeChanged(); curveNode.UpdateTexture(); }); controlsContainer.Add(gradientField); }
internal override void Apply(VisualElement container) { /// <sample> // Get a reference to the field from UXML and assign it its value. var uxmlField = container.Q <CurveField>("the-uxml-field"); uxmlField.value = new AnimationCurve(new Keyframe[] { new Keyframe(0, 0), new Keyframe(5, 8), new Keyframe(10, 4) }); // Create a new field, disable it, and give it a style class. var csharpField = new CurveField("C# Field"); csharpField.SetEnabled(false); csharpField.AddToClassList("some-styled-field"); csharpField.value = uxmlField.value; container.Add(csharpField); // Mirror value of uxml field into the C# field. uxmlField.RegisterCallback <ChangeEvent <AnimationCurve> >((evt) => { csharpField.value = evt.newValue; }); /// </sample> }
void RefreshUI() { rootVisualElement.Clear(); if (Project.projectIdState == Project.State.Pending) { rootVisualElement.Add(new TextElement() { text = "Waiting for connection to Unity Cloud." }); return; } else if (Project.projectIdState == Project.State.Invalid) { rootVisualElement.Add(new TextElement() { text = "Project must be associated with a valid Unity Cloud project to run in Unity Simulation." }); return; } m_NameField = new TextField("Run Name") { viewDataKey = "Run name", }; rootVisualElement.Add(m_NameField); m_BuildZipPathField = new TextField("Path To Player Build .zip") { viewDataKey = "Path to .zip" }; m_ScaleFactorCurve = new CurveField("Scale Factor Range") { viewDataKey = "Scale factor range", }; m_ScaleFactorCurve.RegisterValueChangedCallback(a => UpdateEstimate()); rootVisualElement.Add(m_ScaleFactorCurve); m_StepsField = new IntegerField("Scale Factor Steps") { viewDataKey = "Scale factor steps", maxLength = 4 }; m_StepsField.RegisterValueChangedCallback(a => UpdateEstimate()); rootVisualElement.Add(m_StepsField); m_StepsPerJobField = new IntegerField("Steps Per Instance") { viewDataKey = "Steps per instance", maxLength = 3 }; m_StepsPerJobField.RegisterValueChangedCallback(a => UpdateEstimate()); rootVisualElement.Add(m_StepsPerJobField); m_MaxFramesField = new IntegerField("Max Frames Per Instance") { viewDataKey = "Max frames" }; m_MaxFramesField.RegisterValueChangedCallback(a => UpdateEstimate()); rootVisualElement.Add(m_MaxFramesField); m_MaxForegroundObjectsPerFrame = new IntegerField("Max Objects Per Frame") { maxLength = 3, tooltip = "Max foreground objects per frame", viewDataKey = "Max objects per frame" }; m_MaxForegroundObjectsPerFrame.RegisterValueChangedCallback(a => UpdateEstimate()); rootVisualElement.Add(m_MaxForegroundObjectsPerFrame); m_BackgroundObjectDensityField = new IntegerField("Background Object Density") { viewDataKey = "Background object density", tooltip = "Number of objects per square meter to distribute in a background fill pass." }; rootVisualElement.Add(m_BackgroundObjectDensityField); m_NumBackgroundFillPassesField = new IntegerField("Num Background Passes") { viewDataKey = "Num background passes", tooltip = "Number of times the background generator will generate a collection of objects to fill background", }; rootVisualElement.Add(m_NumBackgroundFillPassesField); // ADR parameters m_ScalingMinField = new FloatField("Occluding Object Scaling Range Minimum") { viewDataKey = "Occluding object scaling range minimum" }; rootVisualElement.Add(m_ScalingMinField); m_ScalingSizeField = new FloatField("Occluding Object Scaling Range Size") { viewDataKey = "Occluding object scaling range size" }; rootVisualElement.Add(m_ScalingSizeField); m_LightColorMinField = new FloatField("Light Color Minimum") { viewDataKey = "Light color minimum" }; rootVisualElement.Add(m_LightColorMinField); m_LightRotationMaxField = new FloatField("Light Rotation Maximum") { viewDataKey = "Light rotation maximum" }; rootVisualElement.Add(m_LightRotationMaxField); m_BackgroundHueMaxOffsetField = new FloatField("Background Hue Maximum Offset") { viewDataKey = "Background hue maximum offset" }; rootVisualElement.Add(m_BackgroundHueMaxOffsetField); m_OccludingHueMaxOffsetField = new FloatField("Occluding Hue Maximum Offset") { viewDataKey = "Occluding hue maximum offset" }; rootVisualElement.Add(m_OccludingHueMaxOffsetField); m_NoiseStrengthMaxField = new FloatField("White Noise Maximum Strength") { viewDataKey = "White noise maximum strength", tooltip = "Maximum limit for range within which the white noise can be randomized per frame." }; rootVisualElement.Add(m_NoiseStrengthMaxField); m_BlurKernelSizeMaxField = new FloatField("Blur Kernel Maximum Size") { viewDataKey = "Blur kernel maximum size", tooltip = "Maximum size in uv coordinates the gaussian blur kernel will be computed over for a given frag." }; rootVisualElement.Add(m_BlurKernelSizeMaxField); m_BlurStandardDeviationMaxField = new FloatField("Blur Standard Deviation Maximum") { viewDataKey = "Blur standard deviation maximum", tooltip = "Maximum limit for the percentage of the kernel size which represents one standard deviation's " + "distance from the center of the kernel." }; rootVisualElement.Add(m_BlurStandardDeviationMaxField); rootVisualElement.Add(new Button(SetDefaultFieldValues) { text = "Reset to Defaults" }); m_EstimateElement = new TextElement(); rootVisualElement.Add(m_EstimateElement); SetDefaultFieldValues(); var sysParamDefinitions = API.GetSysParams(); var sysParamOptions = sysParamDefinitions.Where(s => s.allowed) .Select(s => new SysParamOption() { id = s.id, description = s.description }).ToList(); m_SysParamPopup = new PopupField <SysParamOption>("SysParam", sysParamOptions, sysParamOptions[0]) { viewDataKey = "SysParam" }; rootVisualElement.Add(m_SysParamPopup); rootVisualElement.Add(new Button(OnBeginRunButtonClicked) { text = "Execute on Unity Simulation" }); }
void CreateUIElements() { var titleRow = new VisualElement() { style = { flexDirection = FlexDirection.Row, flexShrink = 0f, justifyContent = Justify.SpaceBetween } }; m_VisualElementContainer.Add(new Label("VisualElements Container")); var curveX = AnimationCurve.Linear(0, 0, 1, 0); var popupFieldValues = new List <SomeClass> { new SomeClass("First Class Value"), new SomeClass("Second Value"), new SomeClass("Another Value"), new SomeClass("Another Value with a very lonnnnnnnnnnnnnnnnnnnnnnnnng text to make sure this is really overflowing the popup field.") }; var maskFieldOptions = new List <string>(m_MaskFieldOptions); m_VisualElementContainer.Add(m_IntegerField = new IntegerField()); m_VisualElementContainer.Add(m_LongField = new LongField()); m_VisualElementContainer.Add(m_FloatField = new FloatField()); m_VisualElementContainer.Add(m_DoubleField = new DoubleField()); m_VisualElementContainer.Add(m_EnumField = new EnumField(EnumValues.Two)); m_VisualElementContainer.Add(m_TextField = new TextField()); m_VisualElementContainer.Add(m_PasswordField = new TextField() { isPasswordField = true, maskChar = '*' }); m_VisualElementContainer.Add(m_Vector3Field = new Vector3Field()); m_VisualElementContainer.Add(m_Vector3IntField = new Vector3IntField()); m_VisualElementContainer.Add(m_Vector2Field = new Vector2Field()); m_VisualElementContainer.Add(m_ColorField = new ColorField()); m_VisualElementContainer.Add(m_ObjectFieldCamera = new ObjectField() { objectType = typeof(Camera) }); m_VisualElementContainer.Add(m_ObjectFieldGameObject = new ObjectField() { objectType = typeof(GameObject) }); m_VisualElementContainer.Add(m_CurveField = new CurveField() { value = curveX }); m_VisualElementContainer.Add(m_CurveFieldMesh = new CurveField() { value = curveX, renderMode = CurveField.RenderMode.Mesh }); m_VisualElementContainer.Add(m_PopupField = new PopupField <SomeClass>(popupFieldValues, popupFieldValues[1])); m_VisualElementContainer.Add(m_RectField = new RectField()); m_VisualElementContainer.Add(m_BoundsField = new BoundsField()); m_VisualElementContainer.Add(m_ToggleField = new Toggle()); m_VisualElementContainer.Add(m_MaskField = new MaskField(maskFieldOptions, 6)); m_VisualElementContainer.Add(m_LayerField = new LayerField()); m_VisualElementContainer.Add(m_TagField = new TagField()); m_VisualElementContainer.Add(m_MinMaxSliderField = new MinMaxSlider(5, 10, 0, 125)); m_VisualElementContainer.Add(m_Slider = new Slider(2, 8)); m_VisualElementContainer.Add(m_SliderInt = new SliderInt(11, 23)); var buttonRow = new VisualElement() { style = { flexDirection = FlexDirection.Row, flexShrink = 0f, } }; buttonRow.Add(new Button() { text = k_ButtonLeftTitle, style = { flexGrow = 1 } }); buttonRow.Add(new Button() { text = k_ButtonRightTitle, style = { flexGrow = 1 } }); m_VisualElementContainer.Add(buttonRow); m_VisualElementContainer.Add(new Button() { text = k_ButtonTopTitle }); m_VisualElementContainer.Add(new Button() { text = k_ButtonBottomTitle }); m_VisualElementContainer.Add(m_ColorField1 = new ColorField()); m_VisualElementContainer.Add(m_LayerMaskField = new LayerMaskField(0)); m_VisualElementContainer.Add(m_MultiLineTextField = new TextField() { multiline = true }); m_VisualElementContainer.Add(m_SliderProgressBar = new SliderInt()); m_VisualElementContainer.Add(m_ProgressBar = new ProgressBar()); m_ProgressBar.title = nameof(ProgressBar); m_SliderProgressBar.lowValue = 0; m_SliderProgressBar.highValue = 100; m_SliderProgressBar.bindingPath = nameof(SliderProgressTestObject.exampleValue); m_ProgressBar.bindingPath = nameof(SliderProgressTestObject.exampleValue); m_SliderProgressBar.Bind(SliderProgressTestSO); m_ProgressBar.Bind(SliderProgressTestSO); // The progress bar by itself does not contain any margin in IMGUI... // In this example, we are artifically adding the textfield margin to it. (see below, in the IMGUI section, ProgressBar()) m_ProgressBar.style.marginBottom = 2f; m_VisualElementContainer.Add(m_GradientField = new GradientField()); RefreshUIElements(); }
void OnEnable() { easingCurvesFuncs[0] = this.SampleCurve; var asset = AssetDatabase.LoadAssetAtPath <VisualTreeAsset>("Assets/Examples/Editor/Transitions.uxml"); var root = this.rootVisualElement; var top = asset.CloneTree(); top.StretchToParentSize(); top.styleSheets.Add(AssetDatabase.LoadAssetAtPath <StyleSheet>("Assets/Examples/Editor/transitions-style.uss")); root.Add(top); canvas = root.Q <VisualElement>("canvas"); var valueContainer = root.Q <VisualElement>("value-container"); PopupField <string> easingPopup = new PopupField <string>(easingcurves, 0); easingPopup.label = "Easing"; easingPopup.RegisterValueChangedCallback((evt) => SetEasingCurve(easingPopup.value)); valueContainer.Insert(0, easingPopup); customCurveField = root.Q <CurveField>(); customCurveField.value = customCurve; durationField = root.Q <IntegerField>(); startButton = root.Q <Button>("start-button"); startButton.clickable.clicked += OnButtonClicked; startButton.name = "start-button"; cursor = new VisualElement(); canvas.Add(cursor); cursor.style.width = cursorSize; cursor.style.height = cursorSize; cursor.style.backgroundColor = Color.red; targetElement = new VisualElement() { name = "target" }; targetElement.style.position = Position.Absolute; canvas.Add(targetElement); int defaultDurationMs = 1000; xAnim = canvas.experimental.animation.Start(0, 1, defaultDurationMs, (e, v) => OnXChanged(v)).Ease(Easing.Linear).KeepAlive(); xAnim.Stop(); xAnim.onAnimationCompleted += UpdateButtonText; durationField.SetValueWithoutNotify(xAnim.durationMs); yAnim = canvas.experimental.animation.Start(0, 1, defaultDurationMs, (e, v) => OnYChanged(v)).Ease(Easing.Linear).KeepAlive(); yAnim.Stop(); cursor.RegisterCallback <GeometryChangedEvent>((e) => UpdateCursorTrail()); easingPopup.value = easingcurves[easingcurves.Count - 1]; SetEasingCurve(easingPopup.value); targetElement.style.right = 0; }
public void Initialize() { if (FieldInfo != null) { var methodInfo = this.GetType().GetMethod("RegisterCallbackInternal", BindingFlags.NonPublic | BindingFlags.Instance); var method = methodInfo.MakeGenericMethod(m_fieldInfo.FieldType); VisualElement visualElement = null; bool failed = false; Type type = m_fieldInfo.FieldType; TitleAttribute titleAttrib = m_fieldInfo.GetCustomAttribute <TitleAttribute>(); string fieldName = ""; if (titleAttrib != null) { fieldName = titleAttrib.Title; } else { fieldName = m_fieldInfo.Name; } if (type == typeof(float)) { visualElement = new FloatField(fieldName); } else if (type == typeof(int)) { visualElement = new IntegerField(fieldName); } else if (type == typeof(string)) { visualElement = new TextField(fieldName); } else if (type == typeof(bool)) { visualElement = new Toggle(fieldName); } else if (type == typeof(AnimationCurve)) { visualElement = new CurveField(fieldName); } else if (type == typeof(Vector2)) { visualElement = new Vector2Field(fieldName); } else if (type == typeof(Vector3)) { visualElement = new Vector3Field(fieldName); } else if (type == typeof(Vector4)) { visualElement = new Vector4Field(fieldName); } else if (type == typeof(Color)) { visualElement = new ColorField(fieldName); } else if (type == typeof(Enum)) { visualElement = new EnumField(fieldName); } else { failed = true; visualElement = new ErrorText("Unsupported Field: " + FieldInfo.Name + ":" + type.Name); visualElement.name = "error-text"; } if (!failed) { var baseFieldType = typeof(BaseField <>).MakeGenericType(type); PropertyInfo info = baseFieldType.GetProperty("value"); info.SetValue(visualElement, m_fieldInfo.GetValue(m_fieldOwner)); method?.Invoke(this, new object[] { visualElement }); } this.Add(visualElement); } }
public void GenerateBlackBoard(GraphData currentData) { Blackboard blackboard = new Blackboard(this) { scrollable = true, }; blackboard.AddToClassList("grayboard"); //blackboard.Add(new BlackboardSection { title="Exposed Properties" }); blackboard.addItemRequested = _blackboard => { }; blackboard.SetPosition(new Rect(10, 30, 200, 200)); this.Add(blackboard); /* Start: how to add to blackboard */ /*var container = new VisualElement(); * var blackboardField = new BlackboardField { * text = "Sample_Property", * typeText = "String Property" * }; * var blackboardFieldValue = new TextField("Value") { * value = "Value" * }; * blackboardFieldValue.RegisterValueChangedCallback(evt => { * Debug.Log(evt.newValue); * }); * var blackBoardRow = new BlackboardRow(blackboardField, blackboardFieldValue); * container.Add(blackboardField); * container.Add(blackBoardRow); * blackboard.Add(container);*/ /* End: how to add to blackboard */ if (currentData != null) { blackboard.title = currentData.name; blackboard.subTitle = "Properties"; FieldInfo[] fields = currentData.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance); //Debug.Log(currentData.GetType()); for (int i = 0; i < fields.Length; i++) { FieldInfo fieldInfo = fields[i]; if (!hiddenFields.Contains(fieldInfo.Name)) { //Debug.Log(fields[i].ToString()); string fName = SplitCamelCase(fieldInfo.Name); var container = new VisualElement(); BlackboardSection bbField; BlackboardRow bbRow; switch (fieldInfo.FieldType.ToString()) { case "System.String": bbField = new BlackboardSection { title = fName }; container.Add(bbField); TextField bbfValue = new TextField() { value = fieldInfo.GetValue(currentData) as string, multiline = true }; bbfValue.RegisterValueChangedCallback(evt => { fieldInfo.SetValue(currentData, evt.newValue); //Debug.Log(evt.newValue); }); bbRow = new BlackboardRow(bbField, bbfValue); container.Add(bbRow); break; case "System.Int32": bbField = new BlackboardSection { title = fName }; container.Add(bbField); IntegerField bbfIntValue = new IntegerField() { value = (int)fieldInfo.GetValue(currentData) }; bbfIntValue.RegisterValueChangedCallback(evt => { fieldInfo.SetValue(currentData, evt.newValue); //Debug.Log(evt.newValue); }); bbRow = new BlackboardRow(bbField, bbfIntValue); container.Add(bbRow); break; case "System.Single": bbField = new BlackboardSection { title = fName }; container.Add(bbField); FloatField bbfFloatValue = new FloatField() { value = (float)fieldInfo.GetValue(currentData) }; bbfFloatValue.RegisterValueChangedCallback(evt => { fieldInfo.SetValue(currentData, evt.newValue); //Debug.Log(evt.newValue); }); bbRow = new BlackboardRow(bbField, bbfFloatValue); container.Add(bbRow); break; case "UnityEngine.Vector2": bbField = new BlackboardSection { title = fName }; container.Add(bbField); Vector2Field bbfVector2Value = new Vector2Field() { value = (Vector2)fieldInfo.GetValue(currentData) }; bbfVector2Value.RegisterValueChangedCallback(evt => { fieldInfo.SetValue(currentData, evt.newValue); //Debug.Log(evt.newValue); }); bbRow = new BlackboardRow(bbField, bbfVector2Value); container.Add(bbRow); break; case "UnityEngine.Vector3": bbField = new BlackboardSection { title = fName }; container.Add(bbField); Vector3Field bbfVector3Value = new Vector3Field() { value = (Vector3)fieldInfo.GetValue(currentData) }; bbfVector3Value.RegisterValueChangedCallback(evt => { fieldInfo.SetValue(currentData, evt.newValue); //Debug.Log(evt.newValue); }); bbRow = new BlackboardRow(bbField, bbfVector3Value); container.Add(bbRow); break; case "UnityEngine.AnimationCurve": bbField = new BlackboardSection { title = fName }; container.Add(bbField); CurveField bbfAnimationCurveValue = new CurveField() { value = (UnityEngine.AnimationCurve)fieldInfo.GetValue(currentData) }; bbfAnimationCurveValue.RegisterValueChangedCallback(evt => { fieldInfo.SetValue(currentData, evt.newValue); //Debug.Log(evt.newValue); }); bbRow = new BlackboardRow(bbField, bbfAnimationCurveValue); container.Add(bbRow); break; default: if (fieldInfo.FieldType.ToString().IndexOf("UnityEngine.") == 0) { bbField = new BlackboardSection { title = fName }; container.Add(bbField); ObjectField bbfObjectValue = new ObjectField() { value = (UnityEngine.Object)fieldInfo.GetValue(currentData), allowSceneObjects = false, objectType = fieldInfo.FieldType }; bbfObjectValue.RegisterValueChangedCallback(evt => { fieldInfo.SetValue(currentData, evt.newValue); //Debug.Log(evt.newValue); }); bbRow = new BlackboardRow(bbField, bbfObjectValue); container.Add(bbRow); } else { bbField = new BlackboardSection { title = fName }; container.Add(bbField); EnumField bbfEnumValue = new EnumField((System.Enum)fieldInfo.GetValue(currentData)) { value = (System.Enum)fieldInfo.GetValue(currentData) }; bbfEnumValue.RegisterValueChangedCallback(evt => { fieldInfo.SetValue(currentData, evt.newValue); //Debug.Log(evt.newValue); }); bbRow = new BlackboardRow(bbField, bbfEnumValue); container.Add(bbRow); } break; } blackboard.Add(container); } } } // Get the properties of 'Type' class object. }