This class lets you define the boundaries of rooms in your level. Rooms are useful if you want to cut your level into portions (think Super Metroid or Hollow Knight for example). These rooms will require their own virtual camera, and a confiner to define their size. Note that the confiner is different from the collider that defines the room. You can see an example of rooms in action in the KoalaRooms demo scene.
More...
This class lets you define the boundaries of rooms in your level. Rooms are useful if you want to cut your level into portions (think Super Metroid or Hollow Knight for example). These rooms will require their own virtual camera, and a confiner to define their size. Note that the confiner is different from the collider that defines the room. You can see an example of rooms in action in the KoalaRooms demo scene.
◆ Modes
◆ Awake()
virtual void MoreMountains.TopDownEngine.Room.Awake |
( |
| ) |
|
|
protectedvirtual |
On Awake we reset our camera's priority
◆ HandleLevelStartDetection()
virtual void MoreMountains.TopDownEngine.Room.HandleLevelStartDetection |
( |
| ) |
|
|
protectedvirtual |
Looks for the level start position and if it's inside the room, makes this room the current one
◆ Initialization()
virtual void MoreMountains.TopDownEngine.Room.Initialization |
( |
| ) |
|
|
protectedvirtual |
Grabs our Room collider, our main camera, and starts the confiner resize
◆ OnDisable()
virtual void MoreMountains.TopDownEngine.Room.OnDisable |
( |
| ) |
|
|
protectedvirtual |
On enable we stop listening for events
◆ OnEnable()
virtual void MoreMountains.TopDownEngine.Room.OnEnable |
( |
| ) |
|
|
protectedvirtual |
On enable we start listening for events
◆ OnMMEvent()
virtual void MoreMountains.TopDownEngine.Room.OnMMEvent |
( |
TopDownEngineEvent |
topDownEngineEvent | ) |
|
|
virtual |
When we get a respawn event, we ask for a camera reposition
- Parameters
-
◆ PlayerEntersRoom()
virtual void MoreMountains.TopDownEngine.Room.PlayerEntersRoom |
( |
| ) |
|
|
virtual |
Call this to let the room know a player entered
◆ PlayerExitsRoom()
virtual void MoreMountains.TopDownEngine.Room.PlayerExitsRoom |
( |
| ) |
|
|
virtual |
Call this to let this room know a player exited
◆ ResizeConfiner()
virtual IEnumerator MoreMountains.TopDownEngine.Room.ResizeConfiner |
( |
| ) |
|
|
protectedvirtual |
Resizes the confiner
- Returns
◆ Start()
virtual void MoreMountains.TopDownEngine.Room.Start |
( |
| ) |
|
|
protectedvirtual |
On Start we initialize our room
◆ _cameraSize
Vector2 MoreMountains.TopDownEngine.Room._cameraSize |
|
protected |
◆ _initialized
bool MoreMountains.TopDownEngine.Room._initialized = false |
|
protected |
◆ _mainCamera
Camera MoreMountains.TopDownEngine.Room._mainCamera |
|
protected |
◆ _roomCollider
Collider MoreMountains.TopDownEngine.Room._roomCollider |
|
protected |
◆ _roomCollider2D
Collider2D MoreMountains.TopDownEngine.Room._roomCollider2D |
|
protected |
◆ ActivationList
List<GameObject> MoreMountains.TopDownEngine.Room.ActivationList |
a list of gameobjects to enable when entering the room, and disable when exiting it
◆ AutoDetectFirstRoomOnStart
bool MoreMountains.TopDownEngine.Room.AutoDetectFirstRoomOnStart = true |
whether or not this Room should look at the level's start position and declare itself the current room on start or not
◆ CurrentRoom
bool MoreMountains.TopDownEngine.Room.CurrentRoom = false |
whether this room is the current room or not
◆ Mode
whether this room is intended to work in 2D or 3D mode
◆ OnPlayerEntersRoom
UnityEvent MoreMountains.TopDownEngine.Room.OnPlayerEntersRoom |
the event to trigger everytime the player enters the room
◆ OnPlayerEntersRoomForTheFirstTime
UnityEvent MoreMountains.TopDownEngine.Room.OnPlayerEntersRoomForTheFirstTime |
the event to trigger when the player enters the room for the first time
◆ OnPlayerExitsRoom
UnityEvent MoreMountains.TopDownEngine.Room.OnPlayerExitsRoom |
the event to trigger everytime the player exits the room
◆ ResizeConfinerAutomatically
bool MoreMountains.TopDownEngine.Room.ResizeConfinerAutomatically = true |
whether or not the confiner should be auto resized on start to match the camera's size and ratio
◆ RoomDepth
float MoreMountains.TopDownEngine.Room.RoomDepth = 100f |
the depth of the room (used to resize the z value of the confiner
◆ RoomVisited
bool MoreMountains.TopDownEngine.Room.RoomVisited = false |
whether this room has already been visited or not
◆ RoomBounds
Bounds MoreMountains.TopDownEngine.Room.RoomBounds |
|
get |
◆ RoomColliderCenter
Vector3 MoreMountains.TopDownEngine.Room.RoomColliderCenter |
|
get |
the collider for this room
◆ RoomColliderSize
Vector3 MoreMountains.TopDownEngine.Room.RoomColliderSize |
|
get |
The documentation for this class was generated from the following file:
- F:/Github/Store/TopDownEngine/Assets/TopDownEngine/Common/ScriptsCinemachine/Environment/Room.cs