Ejemplo n.º 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;
        }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 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);
        }