Cerebrum™
Loading...
Searching...
No Matches
Cerebrum.RoomObject Class Reference

RoomObject: Class used for each object and sub-object in a room (furniture, medical equipment, etc.). More...

Public Member Functions

RoomObject GetSubObject (string key)
 
void SetSubObject (string key, RoomObject value)
 
Dictionary< string, RoomObjectGetAllSubObjects ()
 
int CountSubObjects ()
 
void MonoSpawn (MonoBehaviour requester, Transform refTransform, Transform myParent=null)
 MonoSpawn is used to handle instantiation of an object at time of level generation. WebGL builds can't handle Asyncronous loading of objects and non-Monobehaviour classes cannot run coroutines. So, to solve this, the RoomObject class uses that Monobehaviour object of the script that requested the Spawn() to actually run and manage the Coroutine.
 
IEnumerator Spawn (Transform refTransform, Transform myParent=null)
 Spawn is used to handle instantiation of an object at time of level generation.
 
void MonoCreate (MonoBehaviour requester, Transform refTransform, Transform myParent=null)
 MonoCreate has the same issues as MonoSpawn, above.
 
IEnumerator Create (Transform refTransform, Transform myParent=null)
 Create is used to handle instantiation of an object dynamically while the level is running. Works like Spawn(), but created to return notification of spawned object to script that requested the spawn. Which it does not seem to be doing yet TODO make this function talk back to the script that requested it.
 

Properties

string locName [get, set]
 
int locNum [get, set]
 
Transform locTransform [get, set]
 
string objectAsset [get, set]
 
GameObject gameObject [get, set]
 
AsyncOperationHandle< GameObject > handle [get, set]
 

Detailed Description

RoomObject: Class used for each object and sub-object in a room (furniture, medical equipment, etc.).

Member Function Documentation

◆ CountSubObjects()

int Cerebrum.RoomObject.CountSubObjects ( )

◆ Create()

IEnumerator Cerebrum.RoomObject.Create ( Transform  refTransform,
Transform  myParent = null 
)

Create is used to handle instantiation of an object dynamically while the level is running. Works like Spawn(), but created to return notification of spawned object to script that requested the spawn. Which it does not seem to be doing yet TODO make this function talk back to the script that requested it.

Parameters
refTransformReference to existing transform with same position/rotation where new object should instantiate.
myParent(optional) Parent object that spawning object should be made a child of. Default is null.

◆ GetAllSubObjects()

Dictionary< string, RoomObject > Cerebrum.RoomObject.GetAllSubObjects ( )

◆ GetSubObject()

RoomObject Cerebrum.RoomObject.GetSubObject ( string  key)
Here is the caller graph for this function:

◆ MonoCreate()

void Cerebrum.RoomObject.MonoCreate ( MonoBehaviour  requester,
Transform  refTransform,
Transform  myParent = null 
)

MonoCreate has the same issues as MonoSpawn, above.

Parameters
requesterThe MonoBehaviour that requested the spawn, which will be the MonoBehaviour that will actually run the Coroutine needed to spawn.
refTransformReference to existing transform with same position/rotation where new object should instantiate.
myParent(optional) Parent object that spawning object should be made a child of. Default is null.

◆ MonoSpawn()

void Cerebrum.RoomObject.MonoSpawn ( MonoBehaviour  requester,
Transform  refTransform,
Transform  myParent = null 
)

MonoSpawn is used to handle instantiation of an object at time of level generation. WebGL builds can't handle Asyncronous loading of objects and non-Monobehaviour classes cannot run coroutines. So, to solve this, the RoomObject class uses that Monobehaviour object of the script that requested the Spawn() to actually run and manage the Coroutine.

Parameters
requesterThe MonoBehaviour that requested the spawn, which will be the MonoBehaviour that will actually run the Coroutine needed to spawn.
refTransformReference to existing transform with same position/rotation where new object should instantiate.
myParent(optional) Parent object that spawning object should be made a child of. Default is null.

◆ SetSubObject()

void Cerebrum.RoomObject.SetSubObject ( string  key,
RoomObject  value 
)

◆ Spawn()

IEnumerator Cerebrum.RoomObject.Spawn ( Transform  refTransform,
Transform  myParent = null 
)

Spawn is used to handle instantiation of an object at time of level generation.

Parameters
refTransformReference to existing transform with same position/rotation where new object should instantiate.
myParent(optional) Parent object that spawning object should be made a child of. Default is null.
Here is the caller graph for this function:

Property Documentation

◆ gameObject

GameObject Cerebrum.RoomObject.gameObject
getset

◆ handle

AsyncOperationHandle<GameObject> Cerebrum.RoomObject.handle
getset

◆ locName

string Cerebrum.RoomObject.locName
getset

◆ locNum

int Cerebrum.RoomObject.locNum
getset

◆ locTransform

Transform Cerebrum.RoomObject.locTransform
getset

◆ objectAsset

string Cerebrum.RoomObject.objectAsset
getset

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