Toggle VFX State
# |-->|-Name--------------------->|-Access--->|-Type/Parameters------------------>|-Parameters/Return------------------------>|-Comments->>
using { /Verse.org }
using { /Verse.org/Native }
using { /Verse.org/SceneGraph }
using { /Verse.org/Simulation }
vfx_state_manager <public> := class<final_super> (component)
{
OnBeginSimulation <override>() : void =
{
(super:)OnBeginSimulation()
for(InteractableComponent : Self.Entity.GetSimulationEntity[].FindDescendantComponents(interactable_component))
{
spawn{WaitForInteract(Entity,InteractableComponent)}
}
}
WaitForInteract <private> (
InteractedEntity : entity,
Interactable : interactable_component
)<suspends> : void =
{
Interactable.SucceededEvent.Await()
ToogleVfx(InteractedEntity)
WaitForInteract(InteractedEntity, Interactable)
}
ToogleVfx <private> (EntityToToogle : entity) : void =
{
if(Vfx := EntityToToogle.GetComponent[particle_system_component])
{
if(Vfx.Enabled = true)
{
Vfx.Disable()
Print("Disable Vfx")
}
else if(Vfx.Enabled = false)
{
Vfx.Enable()
Print("Enable Vfx")
}
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.