本文整理匯總了C#中Terraria.Tile.frameNumber方法的典型用法代碼示例。如果您正苦於以下問題:C# Tile.frameNumber方法的具體用法?C# Tile.frameNumber怎麽用?C# Tile.frameNumber使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Terraria.Tile
的用法示例。
在下文中一共展示了Tile.frameNumber方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SelfFrame8Way
//.........這裏部分代碼省略.........
if (!blockStyle2.right)
{
blockStyle2.Clear();
}
else
{
num1 = num1 | 2;
}
}
}
Framing.BlockStyle blockStyle3 = new Framing.BlockStyle();
if (blockStyle.right)
{
Tile tileSafely1 = Framing.GetTileSafely(i + 1, j);
if (tileSafely1.active() && tileSafely1.type == num)
{
blockStyle3 = Framing.FindBlockStyle(tileSafely1);
if (!blockStyle3.left)
{
blockStyle3.Clear();
}
else
{
num1 = num1 | 4;
}
}
}
Framing.BlockStyle blockStyle4 = new Framing.BlockStyle();
if (blockStyle.bottom)
{
Tile tile1 = Framing.GetTileSafely(i, j + 1);
if (tile1.active() && tile1.type == num)
{
blockStyle4 = Framing.FindBlockStyle(tile1);
if (!blockStyle4.top)
{
blockStyle4.Clear();
}
else
{
num1 = num1 | 8;
}
}
}
if (blockStyle1.left && blockStyle2.top)
{
Tile tileSafely2 = Framing.GetTileSafely(i - 1, j - 1);
if (tileSafely2.active() && tileSafely2.type == num)
{
Framing.BlockStyle blockStyle5 = Framing.FindBlockStyle(tileSafely2);
if (blockStyle5.right && blockStyle5.bottom)
{
num1 = num1 | 16;
}
}
}
if (blockStyle1.right && blockStyle3.top)
{
Tile tile2 = Framing.GetTileSafely(i + 1, j - 1);
if (tile2.active() && tile2.type == num)
{
Framing.BlockStyle blockStyle6 = Framing.FindBlockStyle(tile2);
if (blockStyle6.left && blockStyle6.bottom)
{
num1 = num1 | 32;
}
}
}
if (blockStyle4.left && blockStyle2.bottom)
{
Tile tileSafely3 = Framing.GetTileSafely(i - 1, j + 1);
if (tileSafely3.active() && tileSafely3.type == num)
{
Framing.BlockStyle blockStyle7 = Framing.FindBlockStyle(tileSafely3);
if (blockStyle7.right && blockStyle7.top)
{
num1 = num1 | 64;
}
}
}
if (blockStyle4.right && blockStyle3.bottom)
{
Tile tile3 = Framing.GetTileSafely(i + 1, j + 1);
if (tile3.active() && tile3.type == num)
{
Framing.BlockStyle blockStyle8 = Framing.FindBlockStyle(tile3);
if (blockStyle8.left && blockStyle8.top)
{
num1 = num1 | 128;
}
}
}
if (resetFrame)
{
centerTile.frameNumber((byte)WorldGen.genRand.Next(0, 3));
}
Point16 point16 = Framing.selfFrame8WayLookup[num1][centerTile.frameNumber()];
centerTile.frameX = point16.X;
centerTile.frameY = point16.Y;
}
示例2: SelfFrame8Way
//.........這裏部分代碼省略.........
if (blockStyle3.right)
{
num |= 2;
}
else
{
blockStyle3.Clear();
}
}
}
Framing.BlockStyle blockStyle4 = default(Framing.BlockStyle);
if (blockStyle.right)
{
Tile tileSafely3 = Framing.GetTileSafely(i + 1, j);
if (tileSafely3.active() && tileSafely3.type == type)
{
blockStyle4 = Framing.FindBlockStyle(tileSafely3);
if (blockStyle4.left)
{
num |= 4;
}
else
{
blockStyle4.Clear();
}
}
}
Framing.BlockStyle blockStyle5 = default(Framing.BlockStyle);
if (blockStyle.bottom)
{
Tile tileSafely4 = Framing.GetTileSafely(i, j + 1);
if (tileSafely4.active() && tileSafely4.type == type)
{
blockStyle5 = Framing.FindBlockStyle(tileSafely4);
if (blockStyle5.top)
{
num |= 8;
}
else
{
blockStyle5.Clear();
}
}
}
if (blockStyle2.left && blockStyle3.top)
{
Tile tileSafely5 = Framing.GetTileSafely(i - 1, j - 1);
if (tileSafely5.active() && tileSafely5.type == type)
{
Framing.BlockStyle blockStyle6 = Framing.FindBlockStyle(tileSafely5);
if (blockStyle6.right && blockStyle6.bottom)
{
num |= 16;
}
}
}
if (blockStyle2.right && blockStyle4.top)
{
Tile tileSafely6 = Framing.GetTileSafely(i + 1, j - 1);
if (tileSafely6.active() && tileSafely6.type == type)
{
Framing.BlockStyle blockStyle7 = Framing.FindBlockStyle(tileSafely6);
if (blockStyle7.left && blockStyle7.bottom)
{
num |= 32;
}
}
}
if (blockStyle5.left && blockStyle3.bottom)
{
Tile tileSafely7 = Framing.GetTileSafely(i - 1, j + 1);
if (tileSafely7.active() && tileSafely7.type == type)
{
Framing.BlockStyle blockStyle8 = Framing.FindBlockStyle(tileSafely7);
if (blockStyle8.right && blockStyle8.top)
{
num |= 64;
}
}
}
if (blockStyle5.right && blockStyle4.bottom)
{
Tile tileSafely8 = Framing.GetTileSafely(i + 1, j + 1);
if (tileSafely8.active() && tileSafely8.type == type)
{
Framing.BlockStyle blockStyle9 = Framing.FindBlockStyle(tileSafely8);
if (blockStyle9.left && blockStyle9.top)
{
num |= 128;
}
}
}
if (resetFrame)
{
centerTile.frameNumber((byte)WorldGen.genRand.Next(0, 3));
}
Point16 point = Framing.selfFrame8WayLookup[num][(int)centerTile.frameNumber()];
centerTile.frameX = point.X;
centerTile.frameY = point.Y;
}
示例3: ReadTile
public static Tile ReadTile(BinaryReader reader)
{
Tile tile = new Tile();
byte flags = reader.ReadByte();
if ((flags & 1) == 1)
{
byte type = reader.ReadByte();
tile.active(true);
tile.type = type;
if (Main.tileFrameImportant[type])
{
tile.frameNumber(reader.ReadByte());
tile.frameX = reader.ReadInt16();
tile.frameY = reader.ReadInt16();
}
else
{
tile.frameX = -1;
tile.frameY = -1;
}
}
if ((flags & 2) == 2)
{
tile.wall = reader.ReadByte();
}
if ((flags & 4) == 4)
{
tile.liquid = reader.ReadByte();
}
if ((flags & 8) == 8)
{
tile.lava(true);
}
if ((flags & 16) == 16)
{
tile.wire(true);
}
return tile;
}
示例4: WriteTile
public static void WriteTile(BinaryWriter writer, Tile tile)
{
byte flags = 0;
if (tile.active())
{
flags |= 1;
}
if (tile.wall != 0)
{
flags |= 2;
}
if (tile.liquid > 0)
{
flags |= 4;
}
if (tile.lava())
{
flags |= 8;
}
if (tile.wire())
{
flags |= 16;
}
writer.Write(flags);
if ((flags & 1) == 1)
{
writer.Write(tile.type);
if (Main.tileFrameImportant[tile.type])
{
writer.Write(tile.frameNumber());
writer.Write(tile.frameX);
writer.Write(tile.frameY);
}
}
if ((flags & 2) == 2)
{
writer.Write(tile.wall);
}
if ((flags & 4) == 4)
{
writer.Write(tile.liquid);
}
}
示例5: SelfFrame8Way
//.........這裏部分代碼省略.........
Framing.BlockStyle blockStyle1 = Framing.FindBlockStyle(centerTile);
int index = 0;
Framing.BlockStyle blockStyle2 = new Framing.BlockStyle();
if (blockStyle1.top)
{
Tile tileSafely = Framing.GetTileSafely(i, j - 1);
if (tileSafely.active() && (int)tileSafely.type == (int)num)
{
blockStyle2 = Framing.FindBlockStyle(tileSafely);
if (blockStyle2.bottom)
index |= 1;
else
blockStyle2.Clear();
}
}
Framing.BlockStyle blockStyle3 = new Framing.BlockStyle();
if (blockStyle1.left)
{
Tile tileSafely = Framing.GetTileSafely(i - 1, j);
if (tileSafely.active() && (int)tileSafely.type == (int)num)
{
blockStyle3 = Framing.FindBlockStyle(tileSafely);
if (blockStyle3.right)
index |= 2;
else
blockStyle3.Clear();
}
}
Framing.BlockStyle blockStyle4 = new Framing.BlockStyle();
if (blockStyle1.right)
{
Tile tileSafely = Framing.GetTileSafely(i + 1, j);
if (tileSafely.active() && (int)tileSafely.type == (int)num)
{
blockStyle4 = Framing.FindBlockStyle(tileSafely);
if (blockStyle4.left)
index |= 4;
else
blockStyle4.Clear();
}
}
Framing.BlockStyle blockStyle5 = new Framing.BlockStyle();
if (blockStyle1.bottom)
{
Tile tileSafely = Framing.GetTileSafely(i, j + 1);
if (tileSafely.active() && (int)tileSafely.type == (int)num)
{
blockStyle5 = Framing.FindBlockStyle(tileSafely);
if (blockStyle5.top)
index |= 8;
else
blockStyle5.Clear();
}
}
if (blockStyle2.left && blockStyle3.top)
{
Tile tileSafely = Framing.GetTileSafely(i - 1, j - 1);
if (tileSafely.active() && (int)tileSafely.type == (int)num)
{
Framing.BlockStyle blockStyle6 = Framing.FindBlockStyle(tileSafely);
if (blockStyle6.right && blockStyle6.bottom)
index |= 16;
}
}
if (blockStyle2.right && blockStyle4.top)
{
Tile tileSafely = Framing.GetTileSafely(i + 1, j - 1);
if (tileSafely.active() && (int)tileSafely.type == (int)num)
{
Framing.BlockStyle blockStyle6 = Framing.FindBlockStyle(tileSafely);
if (blockStyle6.left && blockStyle6.bottom)
index |= 32;
}
}
if (blockStyle5.left && blockStyle3.bottom)
{
Tile tileSafely = Framing.GetTileSafely(i - 1, j + 1);
if (tileSafely.active() && (int)tileSafely.type == (int)num)
{
Framing.BlockStyle blockStyle6 = Framing.FindBlockStyle(tileSafely);
if (blockStyle6.right && blockStyle6.top)
index |= 64;
}
}
if (blockStyle5.right && blockStyle4.bottom)
{
Tile tileSafely = Framing.GetTileSafely(i + 1, j + 1);
if (tileSafely.active() && (int)tileSafely.type == (int)num)
{
Framing.BlockStyle blockStyle6 = Framing.FindBlockStyle(tileSafely);
if (blockStyle6.left && blockStyle6.top)
index |= 128;
}
}
if (resetFrame)
centerTile.frameNumber((byte)WorldGen.genRand.Next(0, 3));
Point16 point16 = Framing.selfFrame8WayLookup[index][(int)centerTile.frameNumber()];
centerTile.frameX = point16.X;
centerTile.frameY = point16.Y;
}