Class EntityCloner
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")]
[DataSerializerGlobal(typeof(CloneSerializer<Prefab>), null, DataSerializerGenericMode.None, false, false, Profile = "Clone")]
[DataSerializerGlobal(typeof(CloneSerializer<Entity>), null, DataSerializerGenericMode.None, false, false, Profile = "Clone")]
public class EntityCloner
- Inheritance
-
objectEntityCloner
Fields
CloneContextProperty
public static readonly PropertyKey<EntityCloner.CloneContext> CloneContextProperty
Field Value
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
entityEntityThe entity.
Returns
- Entity
A cloned entity
Instantiate(Prefab)
Instantiates the content of the prefab provided. Entities, children Entity and their EntityComponent will be cloned. Other assets will be shared.
public static List<Entity> Instantiate(Prefab prefab)
Parameters
prefabPrefabThe prefab to instantiate.