Class ModularSwitch
Wrapper for ScheduleOne ModularSwitch component. Provides a clean API without exposing game types directly.
public sealed class ModularSwitch
- Inheritance
-
ModularSwitch
- Inherited Members
- Extension Methods
Constructors
ModularSwitch(GameObject)
Creates a new wrapper from a GameObject containing a ModularSwitch component.
public ModularSwitch(GameObject gameObject)
Parameters
gameObjectGameObjectGameObject containing a ModularSwitch component.
Properties
IsOn
Gets or sets whether the switch is currently on.
public bool IsOn { get; set; }
Property Value
Methods
SetInteractionMessages(string, string)
Updates the interaction message based on current switch state.
public void SetInteractionMessages(string messageWhenOn, string messageWhenOff)
Parameters
messageWhenOnstringMessage to display when switch is On (e.g. "Lock Doors").
messageWhenOffstringMessage to display when switch is Off (e.g. "Unlock Doors").
SwitchOff()
Turns the switch off programmatically.
public void SwitchOff()
SwitchOn()
Turns the switch on programmatically.
public void SwitchOn()
Events
OnSwitchedOff
Event fired when the switch is turned off.
public event Action? OnSwitchedOff
Event Type
OnSwitchedOn
Event fired when the switch is turned on.
public event Action? OnSwitchedOn
Event Type
OnToggled
Event fired when the switch is toggled on or off.
public event Action<bool>? OnToggled