public void Set(CubeChunk chunk) { chunk.Init(); chunk.SetVisible(false); //chunk.GetComponent<Renderer>().enabled = false; chunkPool.Add(chunk); }
IEnumerator ChunkUpdate() { while (true) { if (pendingChunk.Count > 0) { CubeChunk chunk = pendingChunk.Pop(); if (chunk.NeedRefresh) { chunk.RefreshSelf(); chunk.SetVisible(true); //chunk.GetComponent<Renderer>().enabled = true; } else { continue; } } yield return(null); } }