public void ReuseProductContainer(ReuseableList<object> p) { if (p != productContainer) { containerPool.Destroy(p); } }
public void ReuseSendIDs(ReuseableList<int> p) { if (p != sendedIDs) { listPool.Destroy(p); } }
public ReuseableList<object> GetProductContainer() { if (0 >= productContainer.list.Count) { return null; } var ret = productContainer; productContainer = containerPool.Create(); return ret; }
public ReuseableList<int> GetSendIDs() { if (0 >= sendedIDs.list.Count) { return null; } var ret = sendedIDs; sendedIDs = listPool.Create(); return ret; }
public Context() { closed = false; containerPool = new ObjectPool<ReuseableList<object>>(); productContainer = containerPool.Create(); }
protected virtual void Awake() { listPool = new ObjectPool<ReuseableList<int>>(); sendedIDs = listPool.Create(); }