public void SpawnShield(int _id, float _amount) { EntitySheildItem shield = TObjectPool <EntitySheildItem> .Spawn().Set(_id, _amount); m_Shields.Add(_id, shield); CheckTotalAmount(); }
public SoundPool(string rPoolName, int rInitCount = 0) { this.mObjectPool = new TObjectPool <AudioSource>(OnAlloc, OnFree, OnDestroy); this.mRootGo = UtilTool.CreateGameObject(rPoolName); this.mRootGo.transform.position = new Vector3(0, 0, 0); for (int i = 0; i < rInitCount; i++) { this.mObjectPool.Alloc(); } }
void InitData() { if (loadType == LoadType.IO) { LoadAllPicture(); } else { StartCoroutine(LoadWWWAllPicture()); } int count = allTex2d.Count < minCount ? minCount : allTex2d.Count; Tpool = new TObjectPool <GameObjData>(count, GameObjData.CreateObj, GameObjData.ReleaseObj, string.Empty, picPoolTrans, 0); for (int i = 0; i < count; i++) { Tpool.OnActiveGameObject(pQueue); } RegistBtn(); }
public static void Recycle <T>(this T poolItem) where T : IObjectPool, new() { TObjectPool <T> .Recycle(poolItem); poolItem.OnPoolRecycle(); }
public ClientSession() { m_clientSocket = new ClientSocket(this); _netpacketPool = new TObjectPool <NetPacket>(); Log_Tag = "ClientSession"; }