本文整理汇总了C#中Chunk.DestroyMesh方法的典型用法代码示例。如果您正苦于以下问题:C# Chunk.DestroyMesh方法的具体用法?C# Chunk.DestroyMesh怎么用?C# Chunk.DestroyMesh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chunk
的用法示例。
在下文中一共展示了Chunk.DestroyMesh方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadChunks
void LoadChunks()
{
if (loadTimer >= 0.0f && !busy)
{
if (chunkQueue.Keys.Count > 0)
{
busy = true;
Vector3 info = chunkQueue.Keys.First();
chunkQueue.Remove(chunkQueue.Keys.First());
Chunk chunk = new Chunk();
loadingChunk = chunk;
Vector3 position = new Vector3((int) info.x, (int) info.y, (int) info.z);
int lod = 2;
Vector3 min = position - new Vector3(octreeSize / 2.0f, octreeSize / 2.0f, octreeSize / 2.0f);
float dist = Mathf.Abs((min - Camera.main.transform.position).magnitude);
if (dist <= 96.0f)
lod = 6;
else if (dist > 96.0f && dist <= 192.0f)
lod = 5;
else if (dist > 192.0f && dist <= 288.0f)
lod = 4;
else if (dist > 288.0f && dist <= 384.0f)
lod = 3;
else if (dist > 384.0f && dist <= 512.0f)
lod = 2;
if(chunk.CreateChunk(computeShader, thread, lod, position))
{
cpuStartTime = Time.realtimeSinceStartup;
}
else
{
chunk.containsNothing = true;
loadingChunk.DestroyMesh();
chunks.Add(min, loadingChunk);
loadingChunk = null;
busy = false;
}
}
loadTimer = 0;
}
loadTimer += Time.deltaTime;
}