ManiaMap.Unity
Procedural generation of metroidvania style maps for Unity.
RoomTemplateResource Class Reference

A container for storing a serialized room template. More...

Inheritance diagram for RoomTemplateResource:

Public Member Functions

AssetReferenceGameObject GetAssetReference ()
 Returns the asset reference based on the assigned prefab GUID. More...
 
RoomTemplate GetMMRoomTemplate ()
 Creates a new Mania Map room template from the serialized text and returns it. More...
 
void Initialize (RoomTemplate template, string prefabGuid, string prefabPath)
 Sets the properties for the room template. More...
 

Properties

bool EditId [getset]
 If true, the ID can be edited in the inspector. More...
 
int Id [getset]
 The template unique ID. More...
 
string Name [getset]
 The template name. More...
 
string PrefabGuid [getprivate set]
 The prefab GUID. More...
 
string PrefabPath [getprivate set]
 The path of the prefab from the project root when the template was last updated. More...
 
string SerializedText [getprivate set]
 The serialized text for the template. More...
 

Private Member Functions

void OnValidate ()
 

Private Attributes

bool _editId
 
int _id = -1
 
string _name = "<None>"
 
string _prefabGuid
 
string _prefabPath
 
string _serializedText
 

Detailed Description

A container for storing a serialized room template.

Definition at line 12 of file RoomTemplateResource.cs.

Member Function Documentation

◆ GetAssetReference()

AssetReferenceGameObject GetAssetReference ( )

Returns the asset reference based on the assigned prefab GUID.

Definition at line 90 of file RoomTemplateResource.cs.

◆ GetMMRoomTemplate()

RoomTemplate GetMMRoomTemplate ( )

Creates a new Mania Map room template from the serialized text and returns it.

Exceptions
RoomTemplateNotInitializedExceptionRaised if the serialized text has not been assigned.

Definition at line 79 of file RoomTemplateResource.cs.

◆ Initialize()

void Initialize ( RoomTemplate  template,
string  prefabGuid,
string  prefabPath 
)

Sets the properties for the room template.

Parameters
templateThe Mania Map room template.
prefabGuidThe prefab GUID.
prefabPathThe prefab path.

Definition at line 68 of file RoomTemplateResource.cs.

◆ OnValidate()

void OnValidate ( )
private

Definition at line 57 of file RoomTemplateResource.cs.

Member Data Documentation

◆ _editId

bool _editId
private

Definition at line 15 of file RoomTemplateResource.cs.

◆ _id

int _id = -1
private

Definition at line 22 of file RoomTemplateResource.cs.

◆ _name

string _name = "<None>"
private

Definition at line 29 of file RoomTemplateResource.cs.

◆ _prefabGuid

string _prefabGuid
private

Definition at line 36 of file RoomTemplateResource.cs.

◆ _prefabPath

string _prefabPath
private

Definition at line 43 of file RoomTemplateResource.cs.

◆ _serializedText

string _serializedText
private

Definition at line 51 of file RoomTemplateResource.cs.

Property Documentation

◆ EditId

bool EditId
getset

If true, the ID can be edited in the inspector.

Definition at line 19 of file RoomTemplateResource.cs.

◆ Id

int Id
getset

The template unique ID.

Definition at line 26 of file RoomTemplateResource.cs.

◆ Name

string Name
getset

The template name.

Definition at line 33 of file RoomTemplateResource.cs.

◆ PrefabGuid

string PrefabGuid
getprivate set

The prefab GUID.

Definition at line 40 of file RoomTemplateResource.cs.

◆ PrefabPath

string PrefabPath
getprivate set

The path of the prefab from the project root when the template was last updated.

Definition at line 47 of file RoomTemplateResource.cs.

◆ SerializedText

string SerializedText
getprivate set

The serialized text for the template.

Definition at line 55 of file RoomTemplateResource.cs.


The documentation for this class was generated from the following file: