![]() |
Eye of the Nile Docs
Everything you need to know to get started!
|
If the player is inside a warp zone (such as a door or some form of exit), this script will warp them to the corresponding exit door. In other words, if you go through a door, this script spawns the player on the other side.
Documentation updated 11/10/2024
Public Attributes | |
UnityEvent< string > | collidedEvent |
Unity event triggered when a player begins to warp. | |
StageWarp | stageWarp |
Reference to the StageWarp component, which contains basic information about the warp. | |
Private Member Functions | |
void | WarpToZone () |
Updates WarpInfo and invokes collidedEvent, which hopefully LoadNewStage() in StageLoader is subscribed to (thus loading the destination). | |
void | OnTriggerStay2D (Collider2D collider) |
void | OnTriggerExit2D (Collider2D collider) |
Runs when an object leaves the warp zone. If that object is the player, tell the player it's not standing on a warp anymore. | |
void | Awake () |
Set reference to the StageWarp component. | |
Private Attributes | |
string | _collisionLayer = "Player" |
Layers which object collisions will be searched for. Set to "Player.". | |
|
private |
Set reference to the StageWarp component.
|
private |
Runs when an object leaves the warp zone. If that object is the player, tell the player it's not standing on a warp anymore.
|
private |
Runs when an object is inside the warp zone. If that object is the player, warp the player (unless the warp is classified as a door rather than an exit, in which case wait for the player to press W while inside the warp zone).
|
private |
Updates WarpInfo and invokes collidedEvent, which hopefully LoadNewStage() in StageLoader is subscribed to (thus loading the destination).
|
private |
Layers which object collisions will be searched for. Set to "Player.".
UnityEvent<string> ExitZone.collidedEvent |
Unity event triggered when a player begins to warp.
StageWarp ExitZone.stageWarp |
Reference to the StageWarp component, which contains basic information about the warp.