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
root
objectobjectReferences
YamlAssetMetadata<Guid>throwOnDuplicateIds
boollogger
ILogger
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
root
objectobjectReferences
YamlAssetMetadata<Guid>referenceTargets
Dictionary<Guid, IIdentifiable>clearMissingReferences
boollogger
ILogger
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
root
objectobjectReferences
YamlAssetMetadata<Guid>referenceTargets
Dictionary<Guid, IIdentifiable>clearMissingReferences
boolapplyAction
Action<MemberPath, object, object>logger
ILogger
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
root
objectThe root object to fix up.
objectReferences
YamlAssetMetadata<Guid>The path to each object reference and the Guid of the tar
clearBrokenObjectReferences
boolIf true, any object refernce that cannot be resolved will be reset to null.
throwOnDuplicateIds
boolIf true, an exception will be thrown if two IIdentifiable
logger
ILoggerAn optional logger.