/// <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; }
/// <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(); }
static public void InitPool(this EntityPool pool) { pool.Init(); Pools.Add(pool.Name, pool); //pool.OnStartEnd += CheckAllStarted; }
public static void RegisterDestoryEventTrigger(this EntityPool pool, IZSystem system) { pool.OnPreDestory += _ => system.Execute(); }
public static void RegisterStartEventTrigger(this EntityPool pool, IZSystem system) { pool.OnStartEnd += _ => system.Execute(); }