GlowTrigger¶
A component meant to be added programmatically or via Unity to a GameObject.
This component has 2 purposes with one being optional: it is both a glow effect that can be conditionally activated or deactivated and it can also be used to have a Hazard attached that will be active for certain periods of time periodically. Some Objects NPCControl supports having a GlowTrigger with or without the hazards feature:
The Hazard is optional and it isn't configured by the GlowTrigger, but it does directly control its BoxCollider such that even though the Hazards will technically default to a Spikes
type, GlowTrigger manages it such that the BoxCollider's center is offscreen when the MainManager.player
is shielding. It's effectively behaving as if it was a WalkableSpikes
, but through the GlowTrigger and everything else in the Hazards behaves as if it was a Spikes
. It's possible to override this by having the GameObject have its own Hazards preattached.
This component has many configurations available, here are all the public fields:
parent
: The associated NPCControl with this component. It is meant to be set by the NPCControl adding the component and itshit
value determines if the glow is active or not. If it is not associated with any NPCControl, this is null. It is not meant to be set via the inspector, just be accessible to the games. Iftargetentityid
isn't negative, this is overriden to be thenpcdata
of the map entity whose id istargetentityid
refreshdelay
: The amount of LateUpdate cycles to skip per glow refreshtargetentityid
: If this isn't negative, the value ofparent
is overriden to be thenpcdata
of the map entity whose id istargetentityid
. Itshit
value determines if the glow is active or notflagid
: If this isn't negative, a flags slot that determines if the glow is active or notmaterialid
: The index of the materials array to change the color and the_Emission
property of eachglowparts
elements when refreshing the glowglowparts
: The array of MeshRenderer whose materials[materialid
].color and_Emission
color property will change when refreshing the glow. If this is null or empty, Start will override it to be a single element being the first child MeshRendererglowspeed
: The MainManager.TieFramerate parameter to use as the lerp factor when changing theglowparts
materials's color and_Emission
color propertyeleccd
: Ifelectime
isn't 0.0, this is the amount of frames left before the Hazards's BoxCollider becomes active. This isn't meant to be set via the inspector, but it is exposed to the game specifically for event 95 (actuating a switch in on the first room of the Honey Factory) to control for animation reasonsgetactivecolorfromstart
: If this is true, theactivecolor
value won't be used. Instead, the values ofglowparts[0]
materials's color and_Emission
color property will be used as theactivecolor
force
: If this is true, it forces the glow to always be active even if none of the requirements are met which are any of the following:parent
'shit
value is trueflagid
check passesflagvar
check passes
nosound
: This should NEVER be true because it will lead to unexpected behaviors. It was supposed to disable a functionality involving an AudioSource when the hazard feature is enabled, but not all the components properly checks for this and still assumes that the AudioSource existsinvert
: If this is true, reverse the activity of the glow where if it was supposed to be active, it will be inactive and vice versa. NOTE:force
being true takes precedence over thisflagvar
: A vector2 that expresses a flagvar check that determines whether or not the glow is active. If the x component is negative, this featrue is disabled. The check involves flagvar slot x being at least the value of the y componentelectime
: The amount of frames that needs to elapse until the Hazards's BoxCollider becomes active. If this is 0.0, the Hazards feature is disabled. NOTE: It is invalid to have a negative value and doing so will lead to unexpected behaviors where the Hazards will be created, but won't be used in any practical wayelecstay
: Ifelectime
isn't 0.0, this is the amount of frames that the Hazards's BoxCollider stays active onceeleccd
became 0.0deactivatedcolor
: The color to use as the destination of the lerp when the glow is inactive which will affect the values of allglowparts
materials's color and_Emission
color propertyelecp
: An instance ofPrefabs/Particles/Elec
childed to the GameObject, used when the hazard feature is enabled. This isn't meant to be set via the inspector, but it is exposed to the game specifically for event 95 (actuating a switch in on the first room of the Honey Factory) to control for animation reasonsactivecolor
: The color to use as the destination of the lerp when the glow is active which will affect the values of allglowparts
materials's color and_Emission
color property. Ifgetactivecolorfromstart
is true, this value is ignored
Here's some additional notes about the component:
- All
glowparts
gets theNoMapColor
tag on Start which will not cause changes to the material's color when entering an inside - When the hazard becomes active, its BoxCollider's center is set to (0.0, 1.0, 0.0) and when it's inactive or if the MainManager.
player
has ashield
, it is set to offscreen at (0.0, 999.0, 0.0) - When
eleccd
becomes lower than 100.0 (there's less than 100.0 frames left before the hazard becomes active) and the glow is active, the glow refresh logic is overriden to blink the color to pure yellow and pure red periodically untileleccd
becomes 0.0 or lower. This also involves theAudio/Sounds/Alarm2
being played periodically using this component's own AudioSource - When the hazard is active,
elecp
plays andAudio/Sounds/ShockLoop
is played on loop using this component's own AudioSource. It will only stop playing on the next cycle whereeleccd
gets set toelectime
- When the hazard becomes inactive,
elecp
stops playing - Any sound playing as a result of the hazard will be done with a volume of MainManager.
soundvolume
(reduced by half if MainManager.FreePlayer without fly is false)