コード例 #1
0
ファイル: CellSpawner.cs プロジェクト: Master2112/Roguelike
 public static RoomData DefineCell(int x, int y, RoomData.Type type)
 {
     if (GetRoomAtGridPosition(x, y, true) == null)
     {
         RoomData data = new RoomData(new Vector2(x, y), type);
         rooms.Add(data);
         return data;
     }
     else
     {
         GetRoomAtGridPosition(x, y, true).type = type;
         return GetRoomAtGridPosition(x, y, true);
     }
 }
コード例 #2
0
ファイル: CellSpawner.cs プロジェクト: Master2112/Roguelike
 public static RoomData DefineCell(Vector2 gridPos, RoomData.Type type)
 {
     return DefineCell((int)gridPos.X, (int)gridPos.Y, type);
 }
コード例 #3
0
ファイル: CellSpawner.cs プロジェクト: Master2112/Roguelike
 public static RoomData DefineCellFromWorldPos(Vector2 worldPosition, RoomData.Type type)
 {
     Vector2 gridp = PathfindConstants.WorldToGrid(worldPosition);
     return DefineCell(gridp, type);
 }