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 RetroVania 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 RetroVania demo scene.
◆ HandleLevelStartDetection()
virtual void MoreMountains.CorgiEngine.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.CorgiEngine.Room.Initialization |
( |
| ) |
|
|
protectedvirtual |
Grabs our Room collider, our main camera, and starts the confiner resize
◆ OnDisable()
virtual void MoreMountains.CorgiEngine.Room.OnDisable |
( |
| ) |
|
|
protectedvirtual |
On enable we stop listening for events
◆ OnEnable()
virtual void MoreMountains.CorgiEngine.Room.OnEnable |
( |
| ) |
|
|
protectedvirtual |
On enable we start listening for events
◆ OnMMEvent()
virtual void MoreMountains.CorgiEngine.Room.OnMMEvent |
( |
CorgiEngineEvent |
corgiEngineEvent | ) |
|
|
virtual |
When we get a respawn event, we ask for a camera reposition
- Parameters
-
◆ PlayerEntersRoom()
virtual void MoreMountains.CorgiEngine.Room.PlayerEntersRoom |
( |
| ) |
|
|
virtual |
Call this to let the room know a player entered
◆ PlayerExitsRoom()
virtual void MoreMountains.CorgiEngine.Room.PlayerExitsRoom |
( |
| ) |
|
|
virtual |
Call this to let this room know a player exited
◆ ResizeConfiner()
virtual IEnumerator MoreMountains.CorgiEngine.Room.ResizeConfiner |
( |
| ) |
|
|
protectedvirtual |
Resizes the confiner
- Returns
◆ Start()
virtual void MoreMountains.CorgiEngine.Room.Start |
( |
| ) |
|
|
protectedvirtual |
On Start we initialize our room
◆ _cameraSize
Vector2 MoreMountains.CorgiEngine.Room._cameraSize |
|
protected |
◆ _initialized
bool MoreMountains.CorgiEngine.Room._initialized = false |
|
protected |
◆ _mainCamera
Camera MoreMountains.CorgiEngine.Room._mainCamera |
|
protected |
◆ _roomCollider2D
Collider2D MoreMountains.CorgiEngine.Room._roomCollider2D |
|
protected |
◆ ActivationList
List<GameObject> MoreMountains.CorgiEngine.Room.ActivationList |
a list of gameobjects to enable when entering the room, and disable when exiting it
◆ AutoDetectFirstRoomOnStart
bool MoreMountains.CorgiEngine.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
◆ CinemachineCameraConfiner
CinemachineConfiner MoreMountains.CorgiEngine.Room.CinemachineCameraConfiner |
the confiner component of the virtual camera
◆ Confiner
Collider2D MoreMountains.CorgiEngine.Room.Confiner |
the confiner for this room, that will constrain the virtual camera, usually placed on a child object of the Room
◆ CurrentRoom
bool MoreMountains.CorgiEngine.Room.CurrentRoom = false |
whether this room is the current room or not
◆ OnPlayerEntersRoom
UnityEvent MoreMountains.CorgiEngine.Room.OnPlayerEntersRoom |
the event to trigger everytime the player enters the room
◆ OnPlayerEntersRoomForTheFirstTime
UnityEvent MoreMountains.CorgiEngine.Room.OnPlayerEntersRoomForTheFirstTime |
the event to trigger when the player enters the room for the first time
◆ OnPlayerExitsRoom
UnityEvent MoreMountains.CorgiEngine.Room.OnPlayerExitsRoom |
the event to trigger everytime the player exits the room
◆ ResizeConfinerAutomatically
bool MoreMountains.CorgiEngine.Room.ResizeConfinerAutomatically = true |
whether or not the confiner should be auto resized on start to match the camera's size and ratio
◆ RoomVisited
bool MoreMountains.CorgiEngine.Room.RoomVisited = false |
whether this room has already been visited or not
◆ VirtualCamera
CinemachineVirtualCamera MoreMountains.CorgiEngine.Room.VirtualCamera |
the virtual camera associated to this room
◆ RoomCollider
virtual Collider2D MoreMountains.CorgiEngine.Room.RoomCollider |
|
get |
the collider for this room
The documentation for this class was generated from the following file:
- Assets/CorgiEngine/Common/ScriptsCinemachine/Environment/Room.cs