bool DefaultRefreshDataDetect() { bool result = false; Transform trans = tracedObj == null ? PETools.PEUtil.MainCamTransform : tracedObj; Vector3 pos = trans.position; int cur_chunk_x = Mathf.FloorToInt(pos.x) >> evniAsset.SHIFT; int cur_chunk_z = Mathf.FloorToInt(pos.z) >> evniAsset.SHIFT; if (mCenter.x != cur_chunk_x || mCenter.y != cur_chunk_z) { result = true; _curCenter.x = cur_chunk_x; _curCenter.y = cur_chunk_z; } if (result) { if (dataIO.isActive()) { dataIO.StopProcess(); } } return(result); }
public void RefreshImmediately(int cx, int cz) { mIO.StopProcess(); Clear(); mReqsOutput.Clear(); int expand = mEvni.DataExpandNum; for (int i = cx - expand; i <= cx + expand; i++) { for (int j = cz - expand; j <= cz + expand; j++) { RGChunk chunk = RGPoolSig.GetChunk(); chunk.Init(i, j, mEvni); mReqsOutput.reqsChunk.Add(chunk); } } mIO.AddReqs(mReqsOutput.reqsChunk); mIO.ProcessReqsImmediatly(); foreach (RGChunk chunk in mReqsOutput.reqsChunk) { if (chunk.isEmpty) { continue; } mChunks[chunk.xIndex, chunk.zIndex] = chunk; } mCenter = new INTVECTOR2(cx, cz); }