Eye of the Nile Docs
Everything you need to know to get started!
Loading...
Searching...
No Matches
WarpObelisk Class Reference

Detailed Description

Warp Obelisks are interactable objects throughout levels. The ObjectInteractable script triggers its public functions. The player can interact with a Warp Obelisk.prefab to go to Skyhub.unity or to set their spawnpoint.

Documentation updated 3/18/2025

Author
Stephen Nuttall, Alexander Art

Public Member Functions

void SetSpawnpoint ()
 Triggered by ObjectInteractable. If enabled by canSetSpawn, set the DataManager's copy of spawnpoint to this spawnpoint, and activate the warp obelisk.
 
void WarpToSkyhub ()
 Triggered by ObjectInteractable. If the current scene is Skyhub.unity, return to the previous scene. If not, load Skyhub.unity.
 
void ConditionalWarpToSkyhub ()
 Triggered by ObjectInteractable. This will only warp the player to the Skyhub if it's unlocked.
 
void UpdateActiveState ()
 If the warp obelisk needs to change its visual state, then this will update it.
 

Public Attributes

bool canSetSpawn = true
 True if the warp obelisk can be activated, thus setting the player's spawnpoint. The only warp obelisk that has this set to false is the one in Skyhub.unity itself, which is used to return to the warp obelisk the player used to get to there.
 

Protected Attributes

bool isActive = false
 True if the warp obelisk is active, false otherwise.
 

Events

static Action onObeliskActivate
 Triggers when any warp obelisk is activated.
 

Private Member Functions

void Awake ()
 
void OnEnable ()
 Subscribes to the onObeliskActivate event.
 
void OnDisable ()
 Unsubscribes from the onObeliskActivate event.
 

Private Attributes

GameObject unactivated
 Reference to the child object holding the sprite for the unactivated warp obelisk. An unactivated warp obelisk is not the player's current respawn point.
 
GameObject activated
 Reference to the child object holding the sprite for the activated warp obelisk. An activated warp obelisk is the player's current respawn point.
 
Vector2 respawnPoint
 The coordinates the player will respawn at if they die after activating this warp obelisk.
 
DataManager dataManager
 Reference to the DataManager. When the warp obelisk is activated, it tells the DataManager update the respawn point.
 
StageLoader stageLoader
 Reference to the StageLoader. The StageLoader is used to load Skyhub.unity scene in WarpToSkyhub().
 

Member Function Documentation

◆ Awake()

void WarpObelisk.Awake ( )
private

Sets references to unactivated, activated, respawnPoint, DataManager, and StageLoader. If the current spawnpoint in the DataManager is this warp obelisk's spawnpoint, set this warp obelisk to active. isActive is updated and the visual state of the warp obelisk is set.

◆ ConditionalWarpToSkyhub()

void WarpObelisk.ConditionalWarpToSkyhub ( )

Triggered by ObjectInteractable. This will only warp the player to the Skyhub if it's unlocked.

◆ OnDisable()

void WarpObelisk.OnDisable ( )
private

Unsubscribes from the onObeliskActivate event.

◆ OnEnable()

void WarpObelisk.OnEnable ( )
private

Subscribes to the onObeliskActivate event.

◆ SetSpawnpoint()

void WarpObelisk.SetSpawnpoint ( )

Triggered by ObjectInteractable. If enabled by canSetSpawn, set the DataManager's copy of spawnpoint to this spawnpoint, and activate the warp obelisk.

◆ UpdateActiveState()

void WarpObelisk.UpdateActiveState ( )

If the warp obelisk needs to change its visual state, then this will update it.

◆ WarpToSkyhub()

void WarpObelisk.WarpToSkyhub ( )

Triggered by ObjectInteractable. If the current scene is Skyhub.unity, return to the previous scene. If not, load Skyhub.unity.

Member Data Documentation

◆ activated

GameObject WarpObelisk.activated
private

Reference to the child object holding the sprite for the activated warp obelisk. An activated warp obelisk is the player's current respawn point.

◆ canSetSpawn

bool WarpObelisk.canSetSpawn = true

True if the warp obelisk can be activated, thus setting the player's spawnpoint. The only warp obelisk that has this set to false is the one in Skyhub.unity itself, which is used to return to the warp obelisk the player used to get to there.

◆ dataManager

DataManager WarpObelisk.dataManager
private

Reference to the DataManager. When the warp obelisk is activated, it tells the DataManager update the respawn point.

◆ isActive

bool WarpObelisk.isActive = false
protected

True if the warp obelisk is active, false otherwise.

◆ respawnPoint

Vector2 WarpObelisk.respawnPoint
private

The coordinates the player will respawn at if they die after activating this warp obelisk.

◆ stageLoader

StageLoader WarpObelisk.stageLoader
private

Reference to the StageLoader. The StageLoader is used to load Skyhub.unity scene in WarpToSkyhub().

◆ unactivated

GameObject WarpObelisk.unactivated
private

Reference to the child object holding the sprite for the unactivated warp obelisk. An unactivated warp obelisk is not the player's current respawn point.

Event Documentation

◆ onObeliskActivate

Action WarpObelisk.onObeliskActivate
static

Triggers when any warp obelisk is activated.


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