A database of room templates whose room can be instantiated via Addressables.
More...
|
RoomTemplateResource | GetRoomTemplate (int id) |
| Returns the room template with the specified ID. More...
|
|
RoomTemplateResource | GetRoomTemplate (Uid id, LayoutPack layoutPack) |
| Returns the room template for the specified room ID. More...
|
|
IReadOnlyDictionary< int, RoomTemplateResource > | GetRoomTemplates () |
| Returns the dictionary of room templates by ID. More...
|
|
List< RoomComponent > | InstantiateAllRooms (LayoutPack layoutPack, Transform parent=null) |
| Instantiates all rooms in the layout and returns a list of them. More...
|
|
async Task< List< RoomComponent > > | InstantiateAllRoomsAsync (LayoutPack layoutPack, Transform parent=null) |
| Instantiates all rooms in the layout asynchronously and returns the rooms as a result of the task. More...
|
|
RoomComponent | InstantiateRoom (Uid id, LayoutPack layoutPack, Transform parent=null, bool assignLayoutPosition=false) |
| Instantiates the specified room and returns it. More...
|
|
AsyncOperationHandle< GameObject > | InstantiateRoomAsync (Uid id, LayoutPack layoutPack, Transform parent=null, bool assignLayoutPosition=false) |
| Instantiates the specified room asynchronously. Returns an operation handle with the result. More...
|
|
List< RoomComponent > | InstantiateRooms (LayoutPack layoutPack, Transform parent=null, int? z=null) |
| Instantiates the rooms in the specified layer of the layout. More...
|
|
async Task< List< RoomComponent > > | InstantiateRoomsAsync (LayoutPack layoutPack, Transform parent=null, int? z=null) |
| Instantiates the rooms in a specified layer of the layout asynchronously. Returns the rooms as a result of the task. More...
|
|
void | MarkDirty () |
| Sets the object as dirty. More...
|
|
A database of room templates whose room can be instantiated via Addressables.
Definition at line 15 of file RoomTemplateDatabase.cs.
◆ ActivateRooms()
◆ Awake()
◆ GetRoomTemplate() [1/2]
◆ GetRoomTemplate() [2/2]
Returns the room template for the specified room ID.
- Parameters
-
id | The room ID. |
layoutPack | The layout pack. |
Definition at line 110 of file RoomTemplateDatabase.cs.
◆ GetRoomTemplates()
◆ 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 142 of file RoomTemplateDatabase.cs.
◆ InstantiateAllRoomsAsync()
Instantiates all rooms in the layout asynchronously and returns the rooms as a result of the task.
- Parameters
-
layoutPack | The layout pack. |
parent | The parent transform. |
Definition at line 121 of file RoomTemplateDatabase.cs.
◆ InstantiateRoom()
RoomComponent InstantiateRoom |
( |
Uid |
id, |
|
|
LayoutPack |
layoutPack, |
|
|
Transform |
parent = null , |
|
|
bool |
assignLayoutPosition = false |
|
) |
| |
Instantiates the specified room and returns it.
- Parameters
-
id | The room ID. |
layoutPack | The layout pack. |
parent | The parent transform. |
assignLayoutPosition | If true, moves the room's local position to its position in the layout. |
Definition at line 252 of file RoomTemplateDatabase.cs.
◆ InstantiateRoomAsync()
AsyncOperationHandle< GameObject > InstantiateRoomAsync |
( |
Uid |
id, |
|
|
LayoutPack |
layoutPack, |
|
|
Transform |
parent = null , |
|
|
bool |
assignLayoutPosition = false |
|
) |
| |
Instantiates the specified room asynchronously. Returns an operation handle with the result.
- Parameters
-
id | The room ID. |
layoutPack | The layout pack. |
parent | The parent transform. |
assignLayoutPosition | If true, moves the room's local position to its position in the layout. |
Definition at line 239 of file RoomTemplateDatabase.cs.
◆ InstantiateRooms()
Instantiates the rooms in the specified layer of the layout.
- Parameters
-
layoutPack | The layout pack. |
parent | The parent transform. |
z | The layer (z) coordinate. |
Definition at line 213 of file RoomTemplateDatabase.cs.
◆ InstantiateRoomsAsync()
async Task< List< RoomComponent > > InstantiateRoomsAsync |
( |
LayoutPack |
layoutPack, |
|
|
Transform |
parent = null , |
|
|
int? |
z = null |
|
) |
| |
Instantiates the rooms in a specified layer of the layout asynchronously. Returns the rooms as a result of the task.
- Parameters
-
layoutPack | The layout pack. |
parent | The parent transform. |
z | The layer (z) coordinate. |
Definition at line 163 of file RoomTemplateDatabase.cs.
◆ MarkDirty()
◆ OnInstantiationComplete()
static void OnInstantiationComplete |
( |
AsyncOperationHandle< GameObject > |
handle, |
|
|
List< RoomComponent > |
results |
|
) |
| |
|
staticprivate |
Adds the room from the operation handle result to the results list and deactivates it.
- Parameters
-
handle | The room instantiation operation handle. |
results | The room results list. |
Definition at line 200 of file RoomTemplateDatabase.cs.
◆ OnValidate()
◆ PopulateIfDirty()
◆ PopulateRoomTemplates()
void PopulateRoomTemplates |
( |
| ) |
|
|
private |
Populates the room templates dictionary.
- Exceptions
-
DuplicateIdException | Raised if two unique templates have the same ID. |
Definition at line 77 of file RoomTemplateDatabase.cs.
◆ _templateGroups
◆ IsDirty
◆ RoomTemplates
◆ TemplateGroups
The documentation for this class was generated from the following file: