Пример #1
0
    private Room CreateRoom(int x, int y, RoomLayout layout)
    {
        Room room = new Room(x, y);

        room.layout = layout.GetCopy();
        room.size   = layout.size;
        if (x == size - 1 && y == size - 1)
        {
            room.finalRoom = true;
        }
        return(room);
    }
Пример #2
0
 void LoadRoom(string roomName)
 {
     if (roomName != "")
     {
         loadedRoom = roomName;
         string     path = roomName.TrimStart("Assets/Resources/".ToCharArray());
         RoomLayout room = Resources.Load <RoomLayout>(path);
         if (room != null)
         {
             this.roomName = room.name;
             this.entities = room.GetCopy();
             this.roomSize = room.size;
         }
     }
 }