@@ -58,7 +58,7 @@ public override void OnGUI(Rect fieldRect, SerializedProperty property, GUIConte
5858 EditorGUI . indentLevel = 0 ;
5959
6060 if ( _showChoiceButton )
61- DrawChoiceButton ( buttonRect ) ;
61+ DrawChoiceButton ( buttonRect , property ) ;
6262
6363 DrawValue ( property , valueRect , fieldRect , previousIndent ) ;
6464
@@ -96,9 +96,13 @@ public static SerializedProperty GetValueProperty(SerializedProperty argumentPro
9696 public static void SaveValueProperty ( SerializedProperty argumentProperty , SerializedProperty valueProperty )
9797 {
9898 valueProperty . serializedObject . ApplyModifiedPropertiesWithoutUndo ( ) ;
99+ LogHelper . RemoveLogEntriesByMode ( LogModes . NoScriptAssetWarning ) ;
99100 var value = valueProperty . GetObject ( ) ;
100101 var serializedArgProp = argumentProperty . FindPropertyRelative ( nameof ( PersistentArgument . _serializedArg ) ) ;
101102 serializedArgProp . stringValue = PersistentArgument . SerializeValue ( value , valueProperty . GetObjectType ( ) ) ;
103+
104+ var argument = argumentProperty . GetObject < PersistentArgument > ( ) ;
105+ argument . _initialized = false ;
102106 }
103107
104108 private void DrawValue ( SerializedProperty property , Rect valueRect , Rect totalRect , int indentLevel )
@@ -271,11 +275,13 @@ private static void DrawValueInFoldout(SerializedProperty mainProperty, Serializ
271275 }
272276 }
273277
274- private void DrawChoiceButton ( Rect buttonRect )
278+ private void DrawChoiceButton ( Rect buttonRect , SerializedProperty argumentProperty )
275279 {
276280 if ( GUI . Button ( buttonRect , _isSerialized . boolValue ? "s" : "d" , ButtonStyle ) )
277281 {
278282 _isSerialized . boolValue = ! _isSerialized . boolValue ;
283+ var argument = argumentProperty . GetObject < PersistentArgument > ( ) ;
284+ argument . _initialized = false ;
279285 }
280286 }
281287 }
0 commit comments