Fix serialization of ControlReference when used in prefabs

#3262
This commit is contained in:
Wojtek Figat
2025-03-07 18:55:03 +01:00
parent 06665734e7
commit bc6f4f50cb
3 changed files with 55 additions and 14 deletions

View File

@@ -228,6 +228,23 @@ namespace FlaxEngine.Json
CacheManagedOnly.Dispose();
}
/// <summary>
/// The default implementation of the values comparision function used by the serialization system.
/// </summary>
/// <param name="objA">The object a.</param>
/// <param name="objB">The object b.</param>
/// <returns>True if both objects are equal, otherwise false.</returns>
public static bool SceneObjectEquals(SceneObject objA, SceneObject objB)
{
if (objA == objB)
return true;
if (objA == null || objB == null)
return false;
if (objA.HasPrefabLink && objB.HasPrefabLink)
return objA.PrefabObjectID == objB.PrefabObjectID;
return false;
}
/// <summary>
/// The default implementation of the values comparision function used by the serialization system.
/// </summary>