File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -76,10 +76,18 @@ TypePopupCache GetTypePopup (SerializedProperty property) {
76
76
) ;
77
77
popup . OnItemSelected += item => {
78
78
Type type = item . Type ;
79
- object obj = m_TargetProperty . SetManagedReference ( type ) ;
80
- m_TargetProperty . isExpanded = ( obj != null ) ;
81
- m_TargetProperty . serializedObject . ApplyModifiedProperties ( ) ;
82
- m_TargetProperty . serializedObject . Update ( ) ;
79
+
80
+ // Apply changes to individual serialized objects.
81
+ foreach ( var targetObject in m_TargetProperty . serializedObject . targetObjects ) {
82
+ SerializedObject individualObject = new SerializedObject ( targetObject ) ;
83
+ SerializedProperty individualProperty = individualObject . FindProperty ( m_TargetProperty . propertyPath ) ;
84
+
85
+ object obj = individualProperty . SetManagedReference ( type ) ;
86
+ individualProperty . isExpanded = ( obj != null ) ;
87
+
88
+ individualObject . ApplyModifiedProperties ( ) ;
89
+ individualObject . Update ( ) ;
90
+ }
83
91
} ;
84
92
85
93
result = new TypePopupCache ( popup , state ) ;
You can’t perform that action at this time.
0 commit comments