Class AssetCloner
Allows to clone an asset or values stored in an asset.
public class AssetCloner
- Inheritance
-
AssetCloner
Fields
InvariantObjectListProperty
public static PropertyKey<List<object>> InvariantObjectListProperty
Field Value
Properties
ClonerSelector
public static SerializerSelector ClonerSelector { get; }
Property Value
Methods
Clone(object?, AssetClonerFlags)
Clones the specified asset using asset serialization.
public static object? Clone(object? asset, AssetClonerFlags flags = AssetClonerFlags.None)
Parameters
asset
objectThe asset.
flags
AssetClonerFlagsFlags used to control the cloning process
Returns
- object
A clone of the asset.
Clone(object?, AssetClonerFlags, out Dictionary<Guid, Guid>)
Clones the specified asset using asset serialization.
public static object? Clone(object? asset, AssetClonerFlags flags, out Dictionary<Guid, Guid> idRemapping)
Parameters
asset
objectThe asset.
flags
AssetClonerFlagsFlags used to control the cloning process
idRemapping
Dictionary<Guid, Guid>A dictionary containing the remapping of Id if GenerateNewIdsForIdentifiableObjects has been passed to the cloner.
Returns
- object
A clone of the asset.
Clone(object?, AssetClonerFlags, HashSet<IIdentifiable>?, out Dictionary<Guid, Guid>)
Clones the specified asset using asset serialization.
public static object? Clone(object? asset, AssetClonerFlags flags, HashSet<IIdentifiable>? externalIdentifiable, out Dictionary<Guid, Guid> idRemapping)
Parameters
asset
objectThe asset.
flags
AssetClonerFlagsFlags used to control the cloning process
externalIdentifiable
HashSet<IIdentifiable>idRemapping
Dictionary<Guid, Guid>A dictionary containing the remapping of Id if GenerateNewIdsForIdentifiableObjects has been passed to the cloner.
Returns
- object
A clone of the asset.
Clone<T>(T?, AssetClonerFlags)
Clones the specified asset using asset serialization.
public static T? Clone<T>(T? asset, AssetClonerFlags flags = AssetClonerFlags.None)
Parameters
asset
TThe asset.
flags
AssetClonerFlagsFlags used to control the cloning process
Returns
- T
A clone of the asset.
Type Parameters
T
The type of the asset.
Clone<T>(T?, AssetClonerFlags, out Dictionary<Guid, Guid>)
Clones the specified asset using asset serialization.
public static T? Clone<T>(T? asset, AssetClonerFlags flags, out Dictionary<Guid, Guid> idRemapping)
Parameters
asset
TThe asset.
flags
AssetClonerFlagsFlags used to control the cloning process
idRemapping
Dictionary<Guid, Guid>A dictionary containing the remapping of Id if GenerateNewIdsForIdentifiableObjects has been passed to the cloner.
Returns
- T
A clone of the asset.
Type Parameters
T
The type of the asset.
Clone<T>(T?, AssetClonerFlags, HashSet<IIdentifiable>, out Dictionary<Guid, Guid>)
Clones the specified asset using asset serialization.
public static T? Clone<T>(T? asset, AssetClonerFlags flags, HashSet<IIdentifiable> externalIdentifiable, out Dictionary<Guid, Guid> idRemapping)
Parameters
asset
TThe asset.
flags
AssetClonerFlagsFlags used to control the cloning process
externalIdentifiable
HashSet<IIdentifiable>idRemapping
Dictionary<Guid, Guid>A dictionary containing the remapping of Id if GenerateNewIdsForIdentifiableObjects has been passed to the cloner.
Returns
- T
A clone of the asset.
Type Parameters
T
The type of the asset.