本文整理汇总了C#中Room.setTile方法的典型用法代码示例。如果您正苦于以下问题:C# Room.setTile方法的具体用法?C# Room.setTile怎么用?C# Room.setTile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Room
的用法示例。
在下文中一共展示了Room.setTile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConnectRoom
// Connect a room with current room (this) with a door in the middle of width or height
public void ConnectRoom(Room room)
{
// If current room is after the other room
if (gridPosX > room.GridPosX)
{
tabTiles[roomHeight / 2][0] = "DoorL";
room.setTile((room.RoomHeight / 2), (room.RoomWidth - 1), "DoorR");
this.setDoor(2);
room.setDoor(3);
}
// If current room is before the other room
if (gridPosX < room.GridPosX)
{
tabTiles[roomHeight / 2][room.RoomWidth - 1] = "DoorR";
room.setTile((room.RoomHeight / 2), 0, "DoorL");
this.setDoor(3);
room.setDoor(2);
}
// If current room is over the other room
if (gridPosY > room.GridPosY)
{
tabTiles[0][roomWidth / 2] = "DoorB";
room.setTile((RoomHeight - 1), (room.RoomWidth / 2), "DoorT");
this.setDoor(1);
room.setDoor(0);
}
// If current room is under the other room
if (gridPosY < room.GridPosY)
{
tabTiles[RoomHeight - 1][roomWidth / 2] = "DoorT";
room.setTile(0, (room.RoomWidth / 2), "DoorB");
this.setDoor(0);
room.setDoor(1);
}
}