Table of Contents

Class EntityCloner

Namespace
Stride.Engine.Design
Assembly
Stride.Engine.dll

Provides method for deep cloning of en Entity.

[DataSerializerGlobal(typeof(CloneSerializer<Effect>), null, DataSerializerGenericMode.None, false, false, Profile = "Clone")]
[DataSerializerGlobal(typeof(CloneSerializer<SpriteSheet>), null, DataSerializerGenericMode.None, false, false, Profile = "Clone")]
[DataSerializerGlobal(typeof(CloneSerializer<SamplerState>), null, DataSerializerGenericMode.None, false, false, Profile = "Clone")]
[DataSerializerGlobal(typeof(CloneSerializer<Texture>), null, DataSerializerGenericMode.None, false, false, Profile = "Clone")]
[DataSerializerGlobal(typeof(CloneSerializer<Mesh>), null, DataSerializerGenericMode.None, false, false, Profile = "Clone")]
[DataSerializerGlobal(typeof(CloneSerializer<Model>), null, DataSerializerGenericMode.None, false, false, Profile = "Clone")]
[DataSerializerGlobal(typeof(CloneSerializer<AnimationClip>), null, DataSerializerGenericMode.None, false, false, Profile = "Clone")]
[DataSerializerGlobal(typeof(CloneSerializer<Sound>), null, DataSerializerGenericMode.None, false, false, Profile = "Clone")]
[DataSerializerGlobal(typeof(CloneSerializer<string>), null, DataSerializerGenericMode.None, false, false, Profile = "Clone")]
[DataSerializerGlobal(typeof(CloneSerializer<OfflineRasterizedSpriteFont>), null, DataSerializerGenericMode.None, false, false, Profile = "Clone")]
[DataSerializerGlobal(typeof(CloneSerializer<RuntimeRasterizedSpriteFont>), null, DataSerializerGenericMode.None, false, false, Profile = "Clone")]
[DataSerializerGlobal(typeof(CloneSerializer<SignedDistanceFieldSpriteFont>), null, DataSerializerGenericMode.None, false, false, Profile = "Clone")]
public class EntityCloner
Inheritance
EntityCloner

Fields

CloneContextProperty

public static readonly PropertyKey<EntityCloner.CloneContext> CloneContextProperty

Field Value

PropertyKey<EntityCloner.CloneContext>

Methods

Clone(Entity)

Clones the specified entity. Entity, children Entity and their EntityComponent will be cloned. Other assets will be shared.

public static Entity Clone(Entity entity)

Parameters

entity Entity

The entity.

Returns

Entity

A cloned entity

Clone(Prefab)

Clones the specified prefab. Entity, children Entity and their EntityComponent will be cloned. Other assets will be shared.

public static Prefab Clone(Prefab prefab)

Parameters

prefab Prefab

The prefab to clone.

Returns

Prefab

A cloned prefab