本文整理匯總了C#中Substrate.ChunkRef.GetSouthNeighbor方法的典型用法代碼示例。如果您正苦於以下問題:C# ChunkRef.GetSouthNeighbor方法的具體用法?C# ChunkRef.GetSouthNeighbor怎麽用?C# ChunkRef.GetSouthNeighbor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Substrate.ChunkRef
的用法示例。
在下文中一共展示了ChunkRef.GetSouthNeighbor方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetNeighborBlock
private AlphaBlockRef GetNeighborBlock(ChunkRef chunk, int x, int y, int z)
{
if (chunk == null)
return new AlphaBlockRef();
ChunkRef target = chunk;
if (x < 0) {
target = chunk.GetNorthNeighbor();
x += chunk.Blocks.XDim;
}
else if (x >= chunk.Blocks.XDim) {
target = chunk.GetSouthNeighbor();
x -= chunk.Blocks.XDim;
}
else if (z < 0) {
target = chunk.GetEastNeighbor();
z += chunk.Blocks.ZDim;
}
else if (z >= chunk.Blocks.ZDim) {
target = chunk.GetWestNeighbor();
z -= chunk.Blocks.ZDim;
}
else
return target.Blocks.GetBlockRef(x, y, z);
return GetNeighborBlock(target, x, y, z);
}