File tree 2 files changed +14
-3
lines changed
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ namespace AGXUnity
18
18
/// Wire.RouteNode myNode = route.FirstOrDefault( node => node.Frame == thisFrame );
19
19
/// </example>
20
20
[ Serializable ]
21
- public class WireRoute : Route < WireRouteNode >
21
+ public class WireRoute : Route < WireRouteNode > , ISerializationCallbackReceiver
22
22
{
23
23
/// <summary>
24
24
/// Checks validity of current route.
@@ -177,5 +177,16 @@ private void OnRemovedFromList( WireRouteNode node, int index )
177
177
{
178
178
node . Wire = null ;
179
179
}
180
+
181
+ public void OnBeforeSerialize ( ) { }
182
+
183
+ public void OnAfterDeserialize ( )
184
+ {
185
+ // Remove callback if it exists to avoid any possible duplicates
186
+ OnNodeAdded -= this . OnAddedToList ;
187
+ OnNodeRemoved -= this . OnRemovedFromList ;
188
+ OnNodeAdded += this . OnAddedToList ;
189
+ OnNodeRemoved += this . OnRemovedFromList ;
190
+ }
180
191
}
181
192
}
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ public static void ApplyPatches()
91
91
HandlePrefabPath ( prefabs [ i ] ) ;
92
92
}
93
93
94
- var scenes = AssetDatabase . FindAssets ( "t:scene" ) . Select ( guid => AssetDatabase . GUIDToAssetPath ( guid ) ) . ToArray ( ) ;
94
+ var scenes = AssetDatabase . FindAssets ( "t:scene" ) . Select ( guid => AssetDatabase . GUIDToAssetPath ( guid ) ) . Where ( p => ! p . StartsWith ( "Packages" ) ) . ToArray ( ) ;
95
95
var setup = EditorSceneManager . GetSceneManagerSetup ( ) ;
96
96
for ( int i = 0 ; i < scenes . Length ; i ++ ) {
97
97
EditorUtility . DisplayProgressBar ( "Patching objects to 5.2.0" , "Patching Scenes..." , ( float ) i / scenes . Length ) ;
@@ -228,7 +228,7 @@ private static void MigrateMassProperties( AGXUnity.Deprecated.MassProperties ol
228
228
{
229
229
if ( oldMP != null ) {
230
230
var rb = oldMP . RigidBody ;
231
- if ( ! ShouldPatch ) return ;
231
+ if ( rb == null || ! ShouldPatch ) return ;
232
232
CopyDefaultAndUserValue ( oldMP . Mass , rb . MassProperties . Mass ) ;
233
233
CopyDefaultAndUserValue ( oldMP . InertiaDiagonal , rb . MassProperties . InertiaDiagonal ) ;
234
234
CopyDefaultAndUserValue ( oldMP . InertiaOffDiagonal , rb . MassProperties . InertiaOffDiagonal ) ;
You can’t perform that action at this time.
0 commit comments