本文整理汇总了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();
}