Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    EntityCloner Class

    Namespace: Stride.Engine.Design
    Assembly: 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.

    | Improve this Doc View Source

    Fields


    CloneContextProperty

    public static readonly PropertyKey<EntityCloner.CloneContext> CloneContextProperty
    Field Value
    Type Description
    PropertyKey<EntityCloner.CloneContext>
    | Improve this Doc View Source

    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


    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation