Nez.Portable/ECS/Entity.cs
/// <summary>
/// creates a deep clone of this Entity. Subclasses can override this method to copy any custom fields. When overriding,
/// the copyFrom method should be called which will clone all Components, Colliders and Transform children for you. Note that cloned
/// objects will not be added to any Scene! You must add them yourself!
/// </summary>
creates a deep clone of this Entity. Subclasses can override this method to copy any custom fields. When overriding,
the copyFrom method should be called which will clone all Components, Colliders and Transform children for you. Note that cloned
objects will not be added to any Scene. You must add them yourself!
creates a deep clone of this Entity . Subclasses can override this method to copy any custom fields . When overriding the copyFrom method should be called which will clone all Components Colliders and Transform children for you . Note that cloned objects will not be added to any Scene . You must add them yourself!
public virtual Entity clone(Vector2 position = default(Vector2))
        {
            var entity = Activator.CreateInstance(GetType()) as Entity;
            entity.name = name + "(clone)";
            entity.copyFrom(this);
            entity.transform.position = position;
            return entity;
        }
public virtual Entity clone ( Vector2 position = default ( Vector2 ) ) { var entity = Activator . CreateInstance ( GetType ( ) ) as Entity ; entity . name = name + " " ; entity . copyFrom ( this ) ; entity . transform . position = position ; return entity ; }
creates a deep clone of this Entity.
creates a deep clone of this Entity .
position
Vector2