A database of room prefabs.
More...
A database of room prefabs.
Definition at line 13 of file RoomDatabase.cs.
◆ Awake()
◆ GetRoomPrefab() [1/2]
Returns the room prefab with the specified template ID.
- Parameters
-
Definition at line 94 of file RoomDatabase.cs.
◆ GetRoomPrefab() [2/2]
Returns the room prefab with the specified room ID.
- Parameters
-
id | The room ID. |
layoutPack | The layout pack. |
Definition at line 105 of file RoomDatabase.cs.
◆ GetRoomsByTemplateId()
IReadOnlyDictionary< int, RoomComponent > GetRoomsByTemplateId |
( |
| ) |
|
Returns the dictionary of rooms by room template ID.
Definition at line 45 of file RoomDatabase.cs.
◆ InstantiateAllRooms()
Instantiates all rooms in the layout and returns a list of them.
- Parameters
-
layoutPack | The layout pack. |
parent | The parent transform. |
Definition at line 116 of file RoomDatabase.cs.
◆ InstantiateRoom()
RoomComponent InstantiateRoom |
( |
Uid |
id, |
|
|
LayoutPack |
layoutPack, |
|
|
Transform |
parent = null , |
|
|
bool |
assignLayoutPosition = false |
|
) |
| |
Instantiates the room with the specified ID.
- Parameters
-
id | The room ID. |
layoutPack | The layout pack. |
parent | The parent transform. |
assignLayoutPosition | If true, moves the instantiated room's local position to its position in the layout. |
Definition at line 161 of file RoomDatabase.cs.
◆ InstantiateRooms()
Instantiates the rooms in a layer of a layout and returns a list of them.
- Parameters
-
layoutPack | The layout pack. |
z | The layer (z) coordinate of the rooms to instantiate. If null, the first layer coordinate found will be used. |
parent | The parent transform. |
Definition at line 136 of file RoomDatabase.cs.
◆ MarkDirty()
◆ OnValidate()
◆ PopulateIfDirty()
If the object is dirty, populates the room dictionary.
Definition at line 62 of file RoomDatabase.cs.
◆ PopulateRoomsByTemplateId()
void PopulateRoomsByTemplateId |
( |
| ) |
|
|
private |
Populates the room dictionary.
- Exceptions
-
DuplicateIdException | Raised if two unique rooms have the same template ID. |
Definition at line 75 of file RoomDatabase.cs.
◆ _rooms
◆ IsDirty
If true, the database is dirty and requires population.
Definition at line 30 of file RoomDatabase.cs.
◆ Rooms
◆ RoomsByTemplateId
A dictionary of room prefabs by room template ID.
Definition at line 25 of file RoomDatabase.cs.
The documentation for this class was generated from the following file: