本文整理汇总了C#中Chunk.CreateSeamChunk方法的典型用法代码示例。如果您正苦于以下问题:C# Chunk.CreateSeamChunk方法的具体用法?C# Chunk.CreateSeamChunk怎么用?C# Chunk.CreateSeamChunk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chunk
的用法示例。
在下文中一共展示了Chunk.CreateSeamChunk方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FinishUpChunkLoading
void FinishUpChunkLoading()
{
if (finishedChunk)
{
finishedChunk = false;
busy = false;
if (changingChunk == null)
{
if (thread.m_Root != null && loadingChunk != null)
{
//if (loadingChunk.LOD == 6)
//Debug.Log ("Chunk time on CPU: " + (Time.realtimeSinceStartup - cpuStartTime));
loadingChunk.CreateSeamChunk(thread.m_Root, thread.m_Root.min);
if (loadingChunk.GenerateMesh(thread.m_Vertices, thread.m_Normals, thread.m_Indices) > 0)
loadingChunk.containsNothing = false;
List<Chunk> seamChunks = new List<Chunk>();
bool foundAllEight = FindSeamChunks(loadingChunk, seamChunks);
if (foundAllEight)
{
List<OctreeNode> seams = FindSeamNodes(loadingChunk, seamChunks);
OctreeNode seamRoot = loadingChunk.BuildSeamTree(seams, loadingChunk.min, octreeSize * 2);
if (seamRoot != null)
{
Chunk seamChunk = new Chunk();
seamChunk.LOD = 6;
seamChunk.CreateSeamChunk(seamRoot, seamRoot.min);
seamChunk.GenerateMesh();
//Debug.Log (seamChunk.GenerateMesh());
seamChunk.DestroyOctree();
loadingChunk.seamChunk = seamChunk;
}
}
//loadingChunk.DestroyOctree();
}
if (loadingChunk != null && thread.m_Root == null)
loadingChunk.DestroyMesh();
if (loadingChunk != null)
chunks.Add(loadingChunk.min, loadingChunk);
}
else
{
if (thread.m_Root != null && changingChunk != null)
{
changingChunk.clearMesh();
changingChunk.DestroyOctree();
changingChunk.CreateSeamChunk(thread.m_Root, thread.m_Root.min);
//float meshReloadStart = Time.realtimeSinceStartup;
changingChunk.GenerateMesh(thread.m_Vertices, thread.m_Normals, thread.m_Indices);
//Debug.Log (Time.realtimeSinceStartup - meshReloadStart);
List<Chunk> seamChunks = new List<Chunk>();
bool foundAllEight = FindSeamChunks(changingChunk, seamChunks);
if (foundAllEight)
{
List<OctreeNode> seams = FindSeamNodes(changingChunk, seamChunks);
OctreeNode seamRoot = changingChunk.BuildSeamTree(seams, changingChunk.min, octreeSize * 2);
if (seamRoot != null)
{
Chunk seamChunk = changingChunk.seamChunk;
if (seamChunk == null)
{
seamChunk = new Chunk();
changingChunk.seamChunk = seamChunk;
}
if (seamChunk != null)
{
seamChunk.LOD = 6;
seamChunk.CreateSeamChunk(seamRoot, seamRoot.min);
seamChunk.GenerateMesh();
//Debug.Log (seamChunk.GenerateMesh());
seamChunk.DestroyOctree();
}
}
}
//changingChunk.DestroyOctree();
changingChunk = null;
}
}
thread.m_Vertices.Clear();
thread.m_Normals.Clear();
thread.m_Indices.Clear();
loadingChunk = null;
thread.m_Root = null;
}
}