@@ -567,6 +567,8 @@ static void UpdateSyncModes(List<UdonBehaviour> udonBehaviours)
567
567
if ( behaviour . programSource == null || ! ( behaviour . programSource is UdonSharpProgramAsset programAsset ) )
568
568
continue ;
569
569
570
+ int originalModificationcount = modificationCount ;
571
+
570
572
behaviourGameObjects . Add ( behaviour . gameObject ) ;
571
573
572
574
if ( behaviour . Reliable == true &&
@@ -581,6 +583,9 @@ static void UpdateSyncModes(List<UdonBehaviour> udonBehaviours)
581
583
behaviour . Reliable = true ;
582
584
modificationCount ++ ;
583
585
}
586
+
587
+ if ( originalModificationcount != modificationCount )
588
+ PrefabUtility . RecordPrefabInstancePropertyModifications ( behaviour ) ;
584
589
}
585
590
586
591
if ( modificationCount > 0 )
@@ -818,6 +823,8 @@ static void UpdatePublicVariables(List<UdonBehaviour> udonBehaviours)
818
823
if ( behaviour . programSource == null || ! ( behaviour . programSource is UdonSharpProgramAsset programAsset ) )
819
824
continue ;
820
825
826
+ int originalUpdateCount = updatedBehaviourVariables ;
827
+
821
828
IUdonVariableTable publicVariables = behaviour . publicVariables ;
822
829
823
830
Dictionary < string , FieldDefinition > fieldDefinitions = programAsset . fieldDefinitions ;
@@ -964,12 +971,13 @@ static void UpdatePublicVariables(List<UdonBehaviour> udonBehaviours)
964
971
Debug . LogError ( $ "Failed to update public variable { variableSymbol } on behaviour { behaviour } , exception { e } \n \n Please report this error to Merlin!") ;
965
972
}
966
973
}
974
+
975
+ if ( originalUpdateCount != updatedBehaviourVariables )
976
+ PrefabUtility . RecordPrefabInstancePropertyModifications ( behaviour ) ;
967
977
}
968
978
969
979
if ( updatedBehaviourVariables > 0 )
970
- {
971
980
EditorSceneManager . MarkAllScenesDirty ( ) ;
972
- }
973
981
}
974
982
975
983
/// <summary>
0 commit comments