EntityCloner Class
Namespace: Stride.Engine.DesignAssembly: Stride.Engine.dll
Provides method for deep cloning of en Entity.
System.Object →
EntityCloner
Derived from EntityCloner:
[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
| Name | Description | |
|---|---|---|
| Fields | ||
| CloneContextProperty | ||
| Methods | ||
| Clone(Entity) | Clones the specified entity. Entity, children Entity and their EntityComponent will be cloned. Other assets will be shared. |
|
| Clone(Prefab) | Clones the specified prefab. Entity, children Entity and their EntityComponent will be cloned. Other assets will be shared. |
|
Fields
CloneContextProperty
public static readonly PropertyKey<EntityCloner.CloneContext> CloneContextProperty
Field Value
| Type | Description |
|---|---|
| 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
| Type | Name | Description |
|---|---|---|
| Entity | entity | The entity. |
Returns
| Type | Description |
|---|---|
| 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
| Type | Name | Description |
|---|---|---|
| Prefab | prefab | The prefab to clone. |
Returns
| Type | Description |
|---|---|
| Prefab | A cloned prefab |