private void OnClickToRemove(ReorderableList list)
        {
            SerializedProperty element = reorderableList.serializedProperty.GetArrayElementAtIndex(list.index);

            SerializedPropertyExtensions.ClearPropertyCache(element.propertyPath);
            reorderableList.serializedProperty.DeleteArrayElementAtIndex(list.index);
            reorderableList.serializedProperty.serializedObject.ApplyModifiedProperties();
        }
Example #2
0
        private static void DeleteElementAtIndex(SerializedProperty serializedProperty, int targetIndex)
        {
            SerializedProperty actionsPropertyPath = serializedProperty.FindPropertyRelative("actions");

            actionsPropertyPath.DeleteArrayElementAtIndex(targetIndex);
            SerializedPropertyExtensions.ClearPropertyCache(actionsPropertyPath.propertyPath);
            actionsPropertyPath.serializedObject.ApplyModifiedProperties();
            actionsPropertyPath.serializedObject.Update();
        }
 private void OnListOrderChanged(ReorderableList list)
 {
     SerializedPropertyExtensions.ClearPropertyCache(list.serializedProperty.propertyPath);
     list.serializedProperty.serializedObject.ApplyModifiedProperties();
 }