Class ToggleValue
Toggles between two values with on and off triggers.
Inherited Members
Namespace: Unity.VisualScripting
Syntax
[UnitCategory("Control")]
[UnitOrder(19)]
public sealed class ToggleValue : Unit, IUnit, IGraphElementWithDebugData, IGraphElementWithData, IGraphElement, IGraphItem, INotifiedCollectionItem, IDisposable, IPrewarmable, IAotStubbable, IIdentifiable, IAnalyticsIdentifiable
Properties
isOn
Whether the flow is currently on.
Declaration
[DoNotSerialize]
public ValueOutput isOn { get; }
Property Value
Type | Description |
---|---|
ValueOutput |
offValue
The value to return if the toggle is off.
Declaration
[DoNotSerialize]
public ValueInput offValue { get; }
Property Value
Type | Description |
---|---|
ValueInput |
onValue
The value to return if the toggle is on.
Declaration
[DoNotSerialize]
public ValueInput onValue { get; }
Property Value
Type | Description |
---|---|
ValueInput |
startOn
Whether the toggle should start in the on state.
Declaration
[Serialize]
[Inspectable]
[UnitHeaderInspectable("Start On")]
[InspectorToggleLeft]
public bool startOn { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
toggle
Trigger to toggle the state of the toggle.
Declaration
[DoNotSerialize]
public ControlInput toggle { get; }
Property Value
Type | Description |
---|---|
ControlInput |
turnedOff
Triggered when the flow gets turned off.
Declaration
[DoNotSerialize]
public ControlOutput turnedOff { get; }
Property Value
Type | Description |
---|---|
ControlOutput |
turnedOn
Triggered when the flow gets turned on.
Declaration
[DoNotSerialize]
public ControlOutput turnedOn { get; }
Property Value
Type | Description |
---|---|
ControlOutput |
turnOff
Trigger to turn off the toggle.
Declaration
[DoNotSerialize]
[PortLabel("Off")]
public ControlInput turnOff { get; }
Property Value
Type | Description |
---|---|
ControlInput |
turnOn
Trigger to turn on the toggle.
Declaration
[DoNotSerialize]
[PortLabel("On")]
public ControlInput turnOn { get; }
Property Value
Type | Description |
---|---|
ControlInput |
value
The value of the toggle selected depending on the state.
Declaration
[DoNotSerialize]
public ValueOutput value { get; }
Property Value
Type | Description |
---|---|
ValueOutput |
Methods
CreateData()
Declaration
public IGraphElementData CreateData()
Returns
Type | Description |
---|---|
IGraphElementData |
Implements
Definition()
Declaration
protected override void Definition()