|
|
|
|
|
|
listView.style.flexGrow = 1.0f; |
|
|
|
listView.style.height = new StyleLength(listView.itemHeight * 4); |
|
|
|
|
|
|
|
var uniformToggle = template.Q<Toggle>("uniform"); |
|
|
|
|
|
|
|
VisualElement MakeItem() |
|
|
|
{ |
|
|
|
return new CategoricalOptionElement( |
|
|
|
|
|
|
{ |
|
|
|
optionsProperty.DeleteArrayElementAtIndex(i); |
|
|
|
} |
|
|
|
|
|
|
|
ResetProbabilities(); |
|
|
|
|
|
|
|
m_SerializedProperty.serializedObject.ApplyModifiedProperties(); |
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
ResetProbabilities(); |
|
|
|
// New items probability will be 0, unless uniform toggle is true
|
|
|
|
probabilitiesProperty.GetArrayElementAtIndex(probabilitiesProperty.arraySize - 1).floatValue = 0; |
|
|
|
|
|
|
|
if (uniformToggle.value) |
|
|
|
ResetProbabilities(); |
|
|
|
|
|
|
|
m_SerializedProperty.serializedObject.ApplyModifiedProperties(); |
|
|
|
listView.itemsSource = categoricalParameter.probabilities; |
|
|
|
|
|
|
{ |
|
|
|
var optionProperty = optionsProperty.GetArrayElementAtIndex(optionsIndex + i); |
|
|
|
optionProperty.objectReferenceValue = categories[i]; |
|
|
|
probabilitiesProperty.GetArrayElementAtIndex(i).floatValue = 0; |
|
|
|
ResetProbabilities(); |
|
|
|
if (uniformToggle.value) |
|
|
|
ResetProbabilities(); |
|
|
|
|
|
|
|
m_SerializedProperty.serializedObject.ApplyModifiedProperties(); |
|
|
|
listView.itemsSource = categoricalParameter.probabilities; |
|
|
|
|
|
|
evt.StopImmediatePropagation(); |
|
|
|
}); |
|
|
|
|
|
|
|
var uniformToggle = template.Q<Toggle>("uniform"); |
|
|
|
|
|
|
|
var uniformProperty = m_SerializedProperty.FindPropertyRelative("uniform"); |
|
|
|
uniformToggle.BindProperty(uniformProperty); |
|
|
|
|
|
|
|