DoorSameMap¶
A transition zone to and away from an inside of the current map.
Data Arrays¶
data[0]: The id of the map.insidesthis transitions todata[1]: A music id to change the current one when entering the inside (the music is changed back to map.music[0]when exiting it). This is optional, no change happens if it doesn't exist or it's -1vectordata[0]: The position to move the player when entering the insidevectordata[1]: The position to move the player when exiting the insidevectordata[2]: Thecamoffsetto set when entering the inside. This is optional: if the magnitude is below 0.1, no changes happen.vectordata[3]: Thecamangleoffsetto set when entering the inside. This is optional: if the magnitude is below 0.1, no changes happen.vectordata[4]: OVERRIDEN (stores the originalcamoffsetwhen entering the inside for restoring when exiting it)vectordata[5]: OVERRIDEN (stores the originalcamangleoffsetwhen entering the inside for restoring when exiting it)vectordata[6]: Thecamlimitposto set when entering the inside. This is optional: if the magnitude is below 0.1, no changes happen.vectordata[7]: Thecamlimitnegto set when entering the inside. This is optional: if the magnitude is below 0.1, no changes happen.
Additional data¶
regionalflag: If it's positive, it's the regionalflag slot that is set to true when the player collides with this object.activationflag: If it's above 0, the flag slot that is set to true when the player collides with this object. It is not possible to specify 0 and will be treated the same as not providing a value.
CreateEntities¶
The insideid is set to -2 which excludes it from the MapControl.RefreshInsides logic where it could toggle the gameObject enablement if the current insideid didn't match (or entity.hideinside is true while being in the same insideid).
This is also where if data[1] exists with a music id, the corresponding music is loaded and added to the musicpreload list. This list isn't read by anyone, it's just to preload the asset for Unity to load it faster after the map load.
Setup¶
A few adjustements occurs:
- The entity.
alwaysactiveis set to true - The gameObject's isStatic is set to true
- The entity.
rigidis placed in kinematic mode without gravity nointeractis set to true- The layer is set to 0 (default)
- The
scolis disabled
Update¶
If the timer hasn't expired yet, it is decremented by the game's frametime clamped from 0.0 to infinity. Otherwise, if it is 0.0 and the entity isn't dead, a Death coroutine is started with the entity.
MapControl.RefreshInsides¶
If we are getting outside while hideinsides is true (which is only the case to hide the break room part of the AntTunnels map), normally, this method would go through all map entities that are inside (or their entity.hideinside is true) and disable them and keep the others enabled.
This object type is excluded from this logic meaning it will never get deactivated from this.
OnTriggerStay¶
This does nothing if any of the following is true:
- The other gameObject isn't the player
- We are
inevent - We are in a
pause hitis true
The regionalflag slot at regionalflags and the flag slot at activationflag are set to true.
If we aren't in a minipause, a MoveInside coroutine is started on the current map with this object as the caller.