Table of Contents

Class LazySwitch

Namespace
JLChnToZ.VRC

A multi-purpose switch.

[BindEvent(typeof(Button), "onClick", "_SwitchState")]
[BindEvent(typeof(Toggle), "onValueChanged", "_SwitchState")]
public class LazySwitch : UdonSharpEventSender
Inheritance
LazySwitch
Inherited Members
Extension Methods

Properties

State

The current state of this switch.

public int State { get; set; }

Property Value

int

Methods

Interact()

public override void Interact()

OnContactEnter(ContactEnterInfo)

public override void OnContactEnter(ContactEnterInfo info)

Parameters

info ContactEnterInfo

OnContactExit(ContactExitInfo)

public override void OnContactExit(ContactExitInfo info)

Parameters

info ContactExitInfo

OnDeserialization()

public override void OnDeserialization()

OnPickupUseDown()

public override void OnPickupUseDown()

OnPlayerRestored(VRCPlayerApi)

public override void OnPlayerRestored(VRCPlayerApi player)

Parameters

player VRCPlayerApi

OnPreSerialization()

public override void OnPreSerialization()

_SwitchState()

Switch to the next state, or a random state if randomized.

public void _SwitchState()

Remarks

This method bypasses interaction checks, so it can be called from other scripts or events.