本文整理匯總了C#中UltimaXNA.Ultima.World.Maps.Map.GetTileZ方法的典型用法代碼示例。如果您正苦於以下問題:C# Map.GetTileZ方法的具體用法?C# Map.GetTileZ怎麽用?C# Map.GetTileZ使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UltimaXNA.Ultima.World.Maps.Map
的用法示例。
在下文中一共展示了Map.GetTileZ方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: updateSurroundingsAndNormals
private void updateSurroundingsAndNormals(Map map)
{
Point origin = new Point(Entity.Position.X, Entity.Position.Y);
float[] surroundingTilesZ = new float[kSurroundingsIndexes.Length];
for (int i = 0; i < kSurroundingsIndexes.Length; i++)
surroundingTilesZ[i] = map.GetTileZ(origin.X + kSurroundingsIndexes[i].X, origin.Y + kSurroundingsIndexes[i].Y);
m_SurroundingTiles = new Surroundings(
surroundingTilesZ[7], surroundingTilesZ[3], surroundingTilesZ[6]);
bool isFlat = m_SurroundingTiles.IsFlat && m_SurroundingTiles.East == Entity.Z;
if (!isFlat)
{
int low = 0, high = 0, sort = 0;
sort = map.GetAverageZ((int)Entity.Z, (int)m_SurroundingTiles.South, (int)m_SurroundingTiles.East, (int)m_SurroundingTiles.Down, ref low, ref high);
if (sort != SortZ)
{
SortZ = sort;
map.GetMapTile(Entity.Position.X, Entity.Position.Y).ForceSort();
}
}
m_Normals[0] = calculateNormal(
surroundingTilesZ[2], surroundingTilesZ[3],
surroundingTilesZ[0], surroundingTilesZ[6]);
m_Normals[1] = calculateNormal(
Entity.Z, surroundingTilesZ[4],
surroundingTilesZ[1], surroundingTilesZ[7]);
m_Normals[2] = calculateNormal(
surroundingTilesZ[5], surroundingTilesZ[7],
Entity.Z, surroundingTilesZ[9]);
m_Normals[3] = calculateNormal(
surroundingTilesZ[6], surroundingTilesZ[8],
surroundingTilesZ[3], surroundingTilesZ[10]);
updateVertexBuffer();
}