本文整理汇总了C#中Tile.active方法的典型用法代码示例。如果您正苦于以下问题:C# Tile.active方法的具体用法?C# Tile.active怎么用?C# Tile.active使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tile
的用法示例。
在下文中一共展示了Tile.active方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTileData
public static TileObjectData GetTileData(Tile getTile)
{
if (getTile == null || !getTile.active())
{
return null;
}
int type = (int)getTile.type;
if (type < 0 || type >= TileObjectData._data.Count)
{
throw new ArgumentOutOfRangeException("Function called with a bad tile type");
}
TileObjectData tileObjectData = TileObjectData._data[type];
if (tileObjectData == null)
{
return null;
}
int num = (int)getTile.frameX / tileObjectData.CoordinateFullWidth;
int num2 = (int)getTile.frameY / tileObjectData.CoordinateFullHeight;
int num3 = tileObjectData.StyleWrapLimit;
if (num3 == 0)
{
num3 = 1;
}
int num4;
if (tileObjectData.StyleHorizontal)
{
num4 = num2 * num3 + num;
}
else
{
num4 = num * num3 + num2;
}
int num5 = num4 / tileObjectData.StyleMultiplier;
int num6 = num4 % tileObjectData.StyleMultiplier;
if (tileObjectData.SubTiles != null && num5 >= 0 && num5 < tileObjectData.SubTiles.Count)
{
TileObjectData tileObjectData2 = tileObjectData.SubTiles[num5];
if (tileObjectData2 != null)
{
tileObjectData = tileObjectData2;
}
}
if (tileObjectData._alternates != null)
{
for (int i = 0; i < tileObjectData.Alternates.Count; i++)
{
TileObjectData tileObjectData3 = tileObjectData.Alternates[i];
if (tileObjectData3 != null && num6 >= tileObjectData3.Style && num6 <= tileObjectData3.Style + tileObjectData3.RandomStyleRange)
{
return tileObjectData3;
}
}
}
return tileObjectData;
}
示例2: GetObjectOrientation
public Direction GetObjectOrientation(Tile anyTile)
{
if (!anyTile.active())
return Direction.Unknown;
switch ((BlockType)anyTile.type) {
case BlockType.Torch:
if (anyTile.frameX == 44 || anyTile.frameX == 110)
return Direction.Left;
if (anyTile.frameX == 22 || anyTile.frameX == 88)
return Direction.Right;
return Direction.Up;
case BlockType.Sign:
if (anyTile.frameX < 36)
return Direction.Up;
if (anyTile.frameX == 36 || anyTile.frameX == 54)
return Direction.Down;
if (anyTile.frameX == 72 || anyTile.frameX == 90)
return Direction.Right;
return Direction.Left;
case BlockType.CrystalShard:
if (anyTile.frameY == 0)
return Direction.Up;
if (anyTile.frameY == 18)
return Direction.Down;
if (anyTile.frameY == 36)
return Direction.Left;
return Direction.Right;
case BlockType.Switch:
if (anyTile.frameX == 0)
return Direction.Up;
if (anyTile.frameX == 18)
return Direction.Right;
return Direction.Left;
case BlockType.Undefined2:
if (
(anyTile.frameX >= 54 && anyTile.frameX <= 90) &&
(anyTile.frameY == 36 || anyTile.frameY == 54 || anyTile.frameY == 90)
) {
return Direction.Up;
}
if (anyTile.frameX >= 162 && anyTile.frameX <= 198 && anyTile.frameY == 90)
return Direction.Up;
return Direction.Down;
case BlockType.Amber:
case BlockType.Undefined8:
if (anyTile.frameY >= 162)
return Direction.Left;
if (anyTile.frameY >= 108)
return Direction.Right;
if (anyTile.frameY >= 54)
return Direction.Down;
return Direction.Up;
default:
return Direction.Unknown;
}
}
示例3: CheckWaterDeath
public static bool CheckWaterDeath(Tile checkTile)
{
if (!checkTile.active())
{
return false;
}
TileObjectData tileData = TileObjectData.GetTileData(checkTile);
if (tileData == null)
{
return Main.tileWaterDeath[(int)checkTile.type];
}
return tileData.WaterDeath;
}
示例4: BlockPortals
private static bool BlockPortals(Tile t)
{
return t.active() && !Main.tileCut[(int)t.type] && !TileID.Sets.BreakableWhenPlacing[(int)t.type] && Main.tileSolid[(int)t.type];
}