/// <summary> /// Runtimes the build pool. /// </summary> private void RuntimeBuildPool() { InitEntityPoolConfigData(this.PoolNodeRoot); foreach (var e in PoolNodeRoot.GetAllEntities()) { string strData = EntityFileMgr.FindAsset(e.Name); ZEntity en = EntityPoolRuntimeBuildUtils.LoadEntity(e.Name, e.ID, strData); entityPool.AddEntityTemplate(en); } //build the entity tree entityPool.PoolNodeRoot = PoolNodeRoot; }
/// <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); }