示例#1
0
        /// <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;
        }
示例#2
0
文件: ZEntity.cs 项目: zzh-527/ZECS
        /// <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);
        }
示例#3
0
        /// <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);
        }