/// <summary> /// Clone this instance. /// </summary> public ZEntity Clone() { ZEntity newEntity = new ZEntity(); newEntity.Name = Name; newEntity.ID = ID; foreach (var e in components) { var newCom = EntityPoolRuntimeBuildUtils.CloneObject(e); if (newCom != null) { newEntity.AddComponent((IZComponent)newCom); } } return(newEntity); }
/// <summary> /// Clone the specified en. /// </summary> /// <param name="en">En.</param> public ZEntity Clone(ZEntity en) { ZEntity newEntity = (ZEntity)EntityPoolRuntimeBuildUtils.CloneObject((object)en); return(newEntity); }