![]() |
Eye of the Nile Docs
Everything you need to know to get started!
|
This script is a work in progress. It will control most of Geb's bossroom (trigger zone, doors, cutscenes, healthbar visibility). This script mainly consists of:
Documentation updated 5/3/2025
Freeze the player during the cutscenes.
Make the distribution of the falling rocks less RNG-based.
Keep track of the camera's default offset and return the camera to the default offset when Geb is defeated.
Public Member Functions | |
void | GebOpeningCutsceneStarted () |
Called by GebPhaseController once when the opening cutscene starts. | |
void | GebPhase1Started () |
Called by GebPhaseController once when the opening cutscene is over and the bossfight starts. | |
void | GebPhase2Started () |
Called by GebPhaseController once when phase 2 starts. | |
void | GebPhase3Started () |
Called by GebPhaseController once when phase 3 starts. | |
void | GebClosingCutsceneStarted () |
Called by GebPhaseController once when the closing cutscene starts. | |
void | GebDefeated () |
Called by GebPhaseController once when the closing cutscene finishes. | |
void | DecrementRockGolemCount () |
Called by the rock golems when they die. Subtracts 1 from the rock golem count. | |
void | GebInteracted () |
Runs when the player interacts with the Geb interactable. | |
void | GebWarpObelisk () |
Needed for Geb's obelisk to interact with the DataManager without it getting unassigned randomly. | |
Public Attributes | |
PatrolZone | bounds |
Reference to Geb's PatrolZone (Bounds), the left end and right end of Geb's bossroom that the rock golems will move around in. | |
int | rockGolemCount = 0 |
Number of rock golems currently in the room. | |
int | maxRockGolems = 4 |
Maximum number of rock golems that can be present in the room before they stop getting spawned. | |
Protected Attributes | |
CinemachineVirtualCamera | virtualCamera |
Reference to the Virtual Camera. Needed for camera control during the cutscenes. | |
CinemachineFramingTransposer | framingTransposer |
Reference to the Virtual Camera's transposer. Needed for extra camera control. | |
BossHealthbarHUD | healthbar |
Reference to the boss healthbar HUD, used for making it appear and disappear at the start and end of the fight. | |
Animator | animator |
Reference to Geb's animator (used for animating the rock throw in the cutscene). | |
GebPhaseController | phaseController |
Reference to Geb's phase controller. | |
GebBossController | bossController |
Reference to Geb's boss controller. | |
GameObject | player |
Reference to the player object. | |
GameObject | cutsceneRock |
Reference to the rock (prefab) that Geb throws during the opening cutscene. | |
GameObject | doorBlocker |
Reference to the part of the door in the scene that Geb closes off in the opening cutscene. | |
GameObject | fallingSkyRocks |
Reference to the rocks (prefab) that fall from the sky during Geb's earthquake attack in phase 3. | |
GameObject | defeatedMessage |
Reference to the defeat message that appears after Geb is defeated. | |
GameObject | interactableZone |
Reference to the interactable zone for when the player needs to press E after Geb is defeated. | |
GameObject | warpObelisk |
Reference to the warp obelisk that appears after Geb is defeated. | |
GameObject | shatteredGeb |
Reference to the shattered version of Geb that is instantiated after Geb is defeated. | |
Private Member Functions | |
void | Awake () |
Set references. | |
void | Start () |
Access the current zoom to set defaultZoom variable. Also calculate the minimum and maximum x position for the player. | |
void | Update () |
Every frame, activate the logic for the current phase Geb is in. Regardless of phase, keep the player within the bounds of the bossroom. | |
void | InactiveState () |
Runs every frame when Geb is inactive. | |
void | OpeningCutsceneState () |
Runs every frame when the opening cutscene is playing. | |
void | Phase1State () |
Runs every frame when Geb is in phase 1. | |
void | Phase2State () |
Runs every frame when Geb is in phase 2. | |
void | Phase3State () |
Runs every frame when Geb is in phase 3. | |
void | ClosingCutsceneState () |
Runs every frame when Geb is defeated and the closing cutscene is playing. | |
void | DefeatedState () |
Runs every frame when the closing cutscene is over. | |
Private Attributes | |
EventReference | bossMusic |
Reference to Geb's boss music. | |
EventReference | sceneMusic |
Reference to the desert scene music. | |
DataManager | dataManager |
Reference to the DataManager. | |
float | fightZoom = 12f |
How far to zoom out the camera for Geb's bossfight. | |
float | fallingRockSpawnPeriod = 0.075f |
How often a rock will fall from the sky during Geb's earthquake attack. | |
System.Random | rng = new System.Random() |
Create random number generator. | |
float | defaultZoom |
The zoom of the camera before the bossfight starts. | |
float | fallingRockSpawnTimer = 0.0f |
Used for keeping track of when the last rock fell from the sky. | |
float | minPlayerPosX |
The minimum x position that the player can have. Calculated using the player's width and the bounds of the room. | |
float | maxPlayerPosX |
The maximum x position that the player can have. Calculated using the player's width and the bounds of the room. | |
GameObject | summonedRock |
Reference to the rock that is spawned during the opening cutscene. | |
bool | rockAnimated = false |
Used for making sure that Geb's rock throw animation is only triggered once during the opening cutscene. | |
bool | rockSummoned = false |
Used for making sure only one rock is spawned during the opening cutscene. | |
|
private |
Set references.
|
private |
Runs every frame when Geb is defeated and the closing cutscene is playing.
void GebRoomController.DecrementRockGolemCount | ( | ) |
Called by the rock golems when they die. Subtracts 1 from the rock golem count.
|
private |
Runs every frame when the closing cutscene is over.
void GebRoomController.GebClosingCutsceneStarted | ( | ) |
Called by GebPhaseController once when the closing cutscene starts.
void GebRoomController.GebDefeated | ( | ) |
Called by GebPhaseController once when the closing cutscene finishes.
Move the defeated message to Geb.
Make the defeated message visible.
Move the interactable to Geb.
Move the warp obelisk to Geb (y = -50.03f to bring to the ground).
void GebRoomController.GebInteracted | ( | ) |
Runs when the player interacts with the Geb interactable.
void GebRoomController.GebOpeningCutsceneStarted | ( | ) |
Called by GebPhaseController once when the opening cutscene starts.
void GebRoomController.GebPhase1Started | ( | ) |
Called by GebPhaseController once when the opening cutscene is over and the bossfight starts.
void GebRoomController.GebPhase2Started | ( | ) |
Called by GebPhaseController once when phase 2 starts.
void GebRoomController.GebPhase3Started | ( | ) |
Called by GebPhaseController once when phase 3 starts.
void GebRoomController.GebWarpObelisk | ( | ) |
Needed for Geb's obelisk to interact with the DataManager without it getting unassigned randomly.
|
private |
Runs every frame when Geb is inactive.
|
private |
Runs every frame when the opening cutscene is playing.
|
private |
Runs every frame when Geb is in phase 1.
|
private |
Runs every frame when Geb is in phase 2.
|
private |
Runs every frame when Geb is in phase 3.
|
private |
Access the current zoom to set defaultZoom variable. Also calculate the minimum and maximum x position for the player.
|
private |
Every frame, activate the logic for the current phase Geb is in. Regardless of phase, keep the player within the bounds of the bossroom.
|
protected |
Reference to Geb's animator (used for animating the rock throw in the cutscene).
|
protected |
Reference to Geb's boss controller.
|
private |
Reference to Geb's boss music.
PatrolZone GebRoomController.bounds |
Reference to Geb's PatrolZone (Bounds), the left end and right end of Geb's bossroom that the rock golems will move around in.
|
protected |
Reference to the rock (prefab) that Geb throws during the opening cutscene.
|
private |
Reference to the DataManager.
|
private |
The zoom of the camera before the bossfight starts.
|
protected |
Reference to the defeat message that appears after Geb is defeated.
|
protected |
Reference to the part of the door in the scene that Geb closes off in the opening cutscene.
|
private |
How often a rock will fall from the sky during Geb's earthquake attack.
|
private |
Used for keeping track of when the last rock fell from the sky.
|
protected |
Reference to the rocks (prefab) that fall from the sky during Geb's earthquake attack in phase 3.
|
private |
How far to zoom out the camera for Geb's bossfight.
|
protected |
Reference to the Virtual Camera's transposer. Needed for extra camera control.
|
protected |
Reference to the boss healthbar HUD, used for making it appear and disappear at the start and end of the fight.
|
protected |
Reference to the interactable zone for when the player needs to press E after Geb is defeated.
|
private |
The maximum x position that the player can have. Calculated using the player's width and the bounds of the room.
int GebRoomController.maxRockGolems = 4 |
Maximum number of rock golems that can be present in the room before they stop getting spawned.
|
private |
The minimum x position that the player can have. Calculated using the player's width and the bounds of the room.
|
protected |
Reference to Geb's phase controller.
|
protected |
Reference to the player object.
|
private |
Create random number generator.
|
private |
Used for making sure that Geb's rock throw animation is only triggered once during the opening cutscene.
int GebRoomController.rockGolemCount = 0 |
Number of rock golems currently in the room.
|
private |
Used for making sure only one rock is spawned during the opening cutscene.
|
private |
Reference to the desert scene music.
|
protected |
Reference to the shattered version of Geb that is instantiated after Geb is defeated.
|
private |
Reference to the rock that is spawned during the opening cutscene.
|
protected |
Reference to the Virtual Camera. Needed for camera control during the cutscenes.
|
protected |
Reference to the warp obelisk that appears after Geb is defeated.