Table of Contents

Class AssetCloner

Namespace
Stride.Core.Assets
Assembly
Stride.Core.Assets.dll

Allows to clone an asset or values stored in an asset.

public class AssetCloner
Inheritance
AssetCloner
Extension Methods

Fields

InvariantObjectListProperty

public static PropertyKey<List<object>> InvariantObjectListProperty

Field Value

PropertyKey<List<object>>

Properties

ClonerSelector

public static SerializerSelector ClonerSelector { get; }

Property Value

SerializerSelector

Methods

Clone(object, AssetClonerFlags)

Clones the specified asset using asset serialization.

public static object Clone(object asset, AssetClonerFlags flags = AssetClonerFlags.None)

Parameters

asset object

The asset.

flags AssetClonerFlags

Flags 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 object

The asset.

flags AssetClonerFlags

Flags 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 object

The asset.

flags AssetClonerFlags

Flags 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 T

The asset.

flags AssetClonerFlags

Flags 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 T

The asset.

flags AssetClonerFlags

Flags 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 T

The asset.

flags AssetClonerFlags

Flags 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.