|
|
|
|
|
|
{ |
|
|
|
m_SerializedProperty.FindPropertyRelative("target.component").objectReferenceValue = null; |
|
|
|
m_SerializedProperty.FindPropertyRelative("target.propertyName").stringValue = string.Empty; |
|
|
|
m_SerializedProperty.FindPropertyRelative("target.applicationFrequency").enumValueIndex = 0; |
|
|
|
m_SerializedProperty.serializedObject.ApplyModifiedProperties(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
removeButton.clicked += () => |
|
|
|
{ |
|
|
|
probabilitiesProperty.DeleteArrayElementAtIndex(i); |
|
|
|
|
|
|
|
// First delete sets option to null, second delete removes option
|
|
|
|
var numOptions = optionsProperty.arraySize; |
|
|
|
if (numOptions == optionsProperty.arraySize) |
|
|
|
optionsProperty.DeleteArrayElementAtIndex(i); |
|
|
|
|
|
|
|
m_SerializedProperty.serializedObject.ApplyModifiedProperties(); |
|
|
|
listView.itemsSource = categoricalParameter.probabilities; |
|
|
|
listView.Refresh(); |
|
|
|
|
|
|
else |
|
|
|
listView.RemoveFromClassList("uniform-probability"); |
|
|
|
} |
|
|
|
uniformToggle.RegisterCallback<ChangeEvent<bool>>(evt => |
|
|
|
{ |
|
|
|
ToggleProbabilityFields(evt.newValue); |
|
|
|
}); |
|
|
|
if (Application.isPlaying) |
|
|
|
uniformToggle.SetEnabled(false); |
|
|
|
else |
|
|
|
uniformToggle.RegisterCallback<ChangeEvent<bool>>(evt => ToggleProbabilityFields(evt.newValue)); |
|
|
|
|
|
|
|
var seedField = template.Q<IntegerField>("seed"); |
|
|
|
seedField.BindProperty(m_SerializedProperty.FindPropertyRelative("m_Sampler.<baseSeed>k__BackingField")); |
|
|
|