Exemplo n.º 1
0
 /// <summary>
 /// Dels all entity.
 /// </summary>
 /// <param name="config">Config.</param>
 static public void DelAllEntity(ZEntityPoolTree config)
 {
     foreach (var en in config.GetAllEntities())
     {
         DelEntityFile(en.Name);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Syncs the layout.
        /// </summary>
        /// <returns><c>true</c>, if layout was synced, <c>false</c> otherwise.</returns>
        /// <param name="pool">Pool.</param>
        public bool SyncLayout(ZEntityPoolTree pool)
        {
            List <ZEntityNode> newItems = pool.GetAllEntities();

            if (items == null || items.Count == 0)
            {
                //newItems = pool.GetAllEntities();
            }
            else
            {
                var delItems = items.Where((a) => newItems.Find((b) => b.ID == a.wndID) != null).ToList();

                items    = delItems;
                newItems = newItems.Where((a) => items.Find((b) => b.wndID == a.ID) == null).ToList();
            }


            foreach (var n in newItems)
            {
                EditorWindowLayoutItem item = new EditorWindowLayoutItem();
                item.wndID = n.ID;
                item.title = n.Name;
                item.rect  = GetRandomRect();
                items.Add(item);
            }

            return(newItems.Count > 0);
            ///pool.Entities.Join(items, (a)=> a
        }
Exemplo n.º 3
0
        /// <summary>
        /// Loads the pool.
        /// </summary>
        /// <returns>The pool.</returns>
        /// <param name="name">Name.</param>
        static public void LoadPool(UnityEngine.Object target)
        {
            ZEntityPoolTree config = EntityPoolEditorBuildUtils.LoadEntityPoolConfigData(target.name);

            var poolConfig = (EntityPoolConfig)target;

            poolConfig.Reset();

            poolConfig.InitEntityPoolConfigData(config);


            foreach (var e in config.GetAllEntities())
            {
                ZEntity en = EntityPoolEditorBuildUtils.LoadEntity(e.Name, e.ID);

                poolConfig.EntityFileMgr.AddAsset(LoadEntityFileAsset(e.Name));

                poolConfig.AddEntityTemplate(en);
            }
        }