public void SumbmitReqs(INTVECTOR2 center) { Profiler.BeginSample("sr0"); for (int i = 0; i < mReqsOutput.discardChunk.Count; ++i) { mReqsOutput.discardChunk[i].Free(); if (!mChunks.Remove(mReqsOutput.discardChunk[i].xIndex, mReqsOutput.discardChunk[i].zIndex)) { // Debug.LogError ("This key is not exist."); } else { RGPoolSig.RecycleChunk(mReqsOutput.discardChunk[i]); } } Profiler.EndSample(); Profiler.BeginSample("sr1"); for (int i = 0; i < mReqsOutput.reqsChunk.Count; i++) { if (mReqsOutput.reqsChunk[i].isEmpty) { RGPoolSig.RecycleChunk(mReqsOutput.reqsChunk[i]); continue; } // mChunks.Add(key, mReqsOutput.reqsChunk[i]); mChunks[mReqsOutput.reqsChunk[i].xIndex, mReqsOutput.reqsChunk[i].zIndex] = mReqsOutput.reqsChunk[i]; } Profiler.EndSample(); mCenter = center; mReqsOutput.Clear(); }
public void Clear() { foreach (KeyValuePair <int, RGChunk> p in _dicData) { p.Value.Free(); RGPoolSig.RecycleChunk(p.Value); } _dicData.Clear(); }