Class FixupObjectReferences
- Namespace
- Stride.Core.Assets.Serializers
- Assembly
- Stride.Core.Assets.dll
A static class that can be used to fix up object references.
public static class FixupObjectReferences
- Inheritance
-
FixupObjectReferences
Methods
CollectReferenceableObjects(object, YamlAssetMetadata<Guid>, bool, ILogger)
public static Dictionary<Guid, IIdentifiable> CollectReferenceableObjects(object root, YamlAssetMetadata<Guid> objectReferences, bool throwOnDuplicateIds, ILogger logger = null)
Parameters
rootobjectobjectReferencesYamlAssetMetadata<Guid>throwOnDuplicateIdsboolloggerILogger
Returns
FixupReferences(object, YamlAssetMetadata<Guid>, Dictionary<Guid, IIdentifiable>, bool, ILogger)
public static void FixupReferences(object root, YamlAssetMetadata<Guid> objectReferences, Dictionary<Guid, IIdentifiable> referenceTargets, bool clearMissingReferences, ILogger logger = null)
Parameters
rootobjectobjectReferencesYamlAssetMetadata<Guid>referenceTargetsDictionary<Guid, IIdentifiable>clearMissingReferencesboolloggerILogger
FixupReferences(object, YamlAssetMetadata<Guid>, Dictionary<Guid, IIdentifiable>, bool, Action<MemberPath, object, object>, ILogger)
public static void FixupReferences(object root, YamlAssetMetadata<Guid> objectReferences, Dictionary<Guid, IIdentifiable> referenceTargets, bool clearMissingReferences, Action<MemberPath, object, object> applyAction, ILogger logger = null)
Parameters
rootobjectobjectReferencesYamlAssetMetadata<Guid>referenceTargetsDictionary<Guid, IIdentifiable>clearMissingReferencesboolapplyActionAction<MemberPath, object, object>loggerILogger
RunFixupPass(object, YamlAssetMetadata<Guid>, bool, bool, ILogger)
Fix up references represented by the objectReferences dictionary into the root object, by visiting the object
to find all IIdentifiable instances it references, and modify the references described by objectReferences to point
to the proper identifiable object matching the same Guid.
public static void RunFixupPass(object root, YamlAssetMetadata<Guid> objectReferences, bool clearBrokenObjectReferences, bool throwOnDuplicateIds, ILogger logger = null)
Parameters
rootobjectThe root object to fix up.
objectReferencesYamlAssetMetadata<Guid>The path to each object reference and the Guid of the tar
clearBrokenObjectReferencesboolIf true, any object refernce that cannot be resolved will be reset to null.
throwOnDuplicateIdsboolIf true, an exception will be thrown if two IIdentifiable
loggerILoggerAn optional logger.