![]() |
Eye of the Nile Docs
Everything you need to know to get started!
|
This script has functions for opening and closing the door object that this script is attached to. The door can be locked. The reason why a number is used for the doorLocked variable instead of a Boolean is, for example, if two separate events need to contribute toward unlocking the door, the door lock value can be incremented by 1/2 of the total, so the door won't get unlocked until both events happen.
Documentation updated 3/23/2025
Public Member Functions | |
void | OpenDoor () |
Open the door, unless locked. | |
void | ForceOpenDoor () |
Open the door, even if locked. | |
void | CloseDoor () |
Close the door, unless locked. | |
void | ForceCloseDoor () |
Close the door, even if locked. | |
void | ToggleDoor () |
Method for opening/closing the door: closes the door if open, opens the door if closed, unless locked. | |
void | ForceToggleDoor () |
Alternative method for opening/closing the door: closes the door if open, opens the door if closed, even if locked. | |
void | SetLock (float value) |
Use this function to set the value of the lock. Anything greater than 0, and the door is locked. | |
void | ChangeLock (float value) |
Use this function to increment the value of the lock. | |
bool | GetLocked () |
Returns true if the door is locked, otherwise false. | |
bool | GetOpen () |
Returns the current open state of the door. | |
Protected Attributes | |
Sprite | closedSprite |
Reference to the image of the closed door. | |
Sprite | openSprite |
Reference to the image of the open door. | |
GameObject | doorCollider |
Reference to door's collision that goes away when the door is open. | |
bool | openByDefault = false |
Whether the door should be open or closed when the scene is loaded. | |
float | doorLocked = 0f |
If this number is greater than 0, then the door is locked. | |
Private Member Functions | |
void | Start () |
Private Attributes | |
bool | doorOpen = false |
The current state of the door. | |
void DoorObject.ChangeLock | ( | float | value | ) |
Use this function to increment the value of the lock.
void DoorObject.CloseDoor | ( | ) |
Close the door, unless locked.
void DoorObject.ForceCloseDoor | ( | ) |
Close the door, even if locked.
void DoorObject.ForceOpenDoor | ( | ) |
Open the door, even if locked.
void DoorObject.ForceToggleDoor | ( | ) |
Alternative method for opening/closing the door: closes the door if open, opens the door if closed, even if locked.
bool DoorObject.GetLocked | ( | ) |
Returns true if the door is locked, otherwise false.
bool DoorObject.GetOpen | ( | ) |
Returns the current open state of the door.
void DoorObject.OpenDoor | ( | ) |
Open the door, unless locked.
void DoorObject.SetLock | ( | float | value | ) |
Use this function to set the value of the lock. Anything greater than 0, and the door is locked.
|
private |
void DoorObject.ToggleDoor | ( | ) |
Method for opening/closing the door: closes the door if open, opens the door if closed, unless locked.
|
protected |
Reference to the image of the closed door.
|
protected |
Reference to door's collision that goes away when the door is open.
|
protected |
If this number is greater than 0, then the door is locked.
|
private |
The current state of the door.
|
protected |
Whether the door should be open or closed when the scene is loaded.
|
protected |
Reference to the image of the open door.