Exemplo n.º 1
0
        /// <summary>
        /// Inits the entity pool config data.
        /// </summary>
        /// <param name="poolData">Pool data.</param>
        public void InitEntityPoolConfigData(ZEntityPoolTree poolData)
        {
            entityPool = new EntityPool();

            this.PoolNodeRoot = poolData;
            //this.startID = poolData.GetEntityStartID ();
            entityPool.Name   = gameObject.name;
            PoolNodeRoot.Name = gameObject.name;
            entityPool.Name   = poolData.Name;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Reset this instance.
        /// </summary>
        public void Reset()
        {
            if (Application.isPlaying || !Application.isEditor)
            {
                throw new System.Exception("this function can't call in run time");
            }

            PoolNodeRoot = null;
            if (entityPool != null)
            {
                entityPool.ClearTemplate();
                entityPool = null;
            }

            EntityFileMgr.Clear();
        }
Exemplo n.º 3
0
 static public void InitPool(this EntityPool pool)
 {
     pool.Init();
     Pools.Add(pool.Name, pool);
     //pool.OnStartEnd += CheckAllStarted;
 }
Exemplo n.º 4
0
 public static void RegisterDestoryEventTrigger(this EntityPool pool, IZSystem system)
 {
     pool.OnPreDestory += _ => system.Execute();
 }
Exemplo n.º 5
0
 public static void RegisterStartEventTrigger(this EntityPool pool, IZSystem system)
 {
     pool.OnStartEnd += _ => system.Execute();
 }