浏览代码

some cleanup after chat with Steven

/main
Mohsen Kamalzadeh 3 年前
当前提交
dc6d67ef
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 7
      com.unity.perception/Editor/Randomization/PropertyDrawers/UIntDrawer.cs

7
com.unity.perception/Editor/Randomization/PropertyDrawers/UIntDrawer.cs


var field = new UIntField
{
label = property.displayName,
bindingPath = property.propertyPath,
//Binding does not work on this custom UI Element field that we have created, so we need to use the change event
field.RegisterValueChangedCallback(evt =>
{
field.value = evt.newValue;

// Create a surrogate integer field to detect and pass along external change events on the UIntField.
// UIElements currently does not support default change detection on non-SerializedProperty supported types.
// Create a surrogate integer field to detect and pass along external change events (non UI event) on the underlying serialized property.
surrogateField.style.display = new StyleEnum<DisplayStyle>(DisplayStyle.None);
surrogateField.style.display = DisplayStyle.Flex;
surrogateField.bindingPath = property.propertyPath;
surrogateField.RegisterValueChangedCallback(evt =>
{

正在加载...
取消
保存