Component:BooleanSwitcher: Difference between revisions

From Resonite Wiki
fix
add info
 
Line 2: Line 2:
<translate>
<translate>
<!--T:1-->
<!--T:1-->
{{stub}}
{{Infobox Component
{{Infobox Component
|Image=BooleanSwitcherComponent.png
|Image=BooleanSwitcherComponent.png
|Name=Boolean Switcher
|Name=Boolean Switcher
}}
}}
 
The BooleanSwitcher component can be used to enable and disable a list of Slots depending on an index in the list.
The BooleanSwitcher component can be used to enable a specified slot from a list of slots.
It does so by driving the Active field of the slots.
It does so by driving the Active field of the slots.


Line 15: Line 13:
{{Table ComponentFields
{{Table ComponentFields
|AutoAddChildren|Bool| If true, the Targets list will be automatically populated with the child slots of the slot that this component is on.
|AutoAddChildren|Bool| If true, the Targets list will be automatically populated with the child slots of the slot that this component is on.
|AutoAddIgnoreTags|{{RootFieldType|SyncFieldList`1|[[Type:String|String]]}}|TypeAdv1=true|
|AutoAddIgnoreTags|{{RootFieldType|SyncFieldList`1|[[Type:String|String]]}}|TypeAdv1=true| Don't auto add a child slot to the list if it has a tag that is in this list.
|Targets|{{RootFieldType|SyncList`1|[[Type:FieldDrive`1|FieldDrive`1]]&lt;[[Type:Bool|Bool]]&gt;}}|TypeAdv2=true| The list of slots of which one will be enabled.
|Targets|{{RootFieldType|SyncList`1|[[Type:FieldDrive`1|FieldDrive`1]]&lt;[[Type:Bool|Bool]]&gt;}}|TypeAdv2=true| The list of slots of which one will be enabled.
|ActiveIndex|Int| The index of the currently active slot.
|ActiveIndex|Int| The index of the currently active slot.
Line 35: Line 33:
== Examples ==
== Examples ==


* [https://www.youtube.com/watch?v=F0PhN-VxPEI BooleanSwitcher tutorial] by [[User:ProbablePrime|ProbablePrime]]
* [https://www.youtube.com/watch?v=F0PhN-VxPEI BooleanSwitcher tutorial] by [[User:ProbablePrime|ProbablePrime]]. May be out of date.


<!--T:5-->
<!--T:5-->
Line 42: Line 40:


<!--T:6-->
<!--T:6-->
== Related Components ==
== See Also ==
</translate>
</translate>
[[Category:Components{{#translation:}}|Boolean Switcher]]
[[Category:Components{{#translation:}}|Boolean Switcher]]
[[Category:Components With Nested Enums{{#translation:}}|Boolean Switcher]]
[[Category:Components With Nested Enums{{#translation:}}|Boolean Switcher]]
[[Category:Components:Transform:Drivers{{#translation:}}|Boolean Switcher]]
[[Category:Components:Transform:Drivers{{#translation:}}|Boolean Switcher]]

Latest revision as of 22:32, 10 February 2025

Component image 
Boolean Switcher component as seen in the Scene Inspector

The BooleanSwitcher component can be used to enable and disable a list of Slots depending on an index in the list. It does so by driving the Active field of the slots.

Fields

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled. Some components stop their functionality when this field is disabled, but some don't.
AutoAddChildren Bool If true, the Targets list will be automatically populated with the child slots of the slot that this component is on.
AutoAddIgnoreTags direct SyncFieldList`1<String> Don't auto add a child slot to the list if it has a tag that is in this list.
Targets list of FieldDrive`1<Bool> The list of slots of which one will be enabled.
ActiveIndex Int The index of the currently active slot.
ActivationMode Mode Allows for enabling items in Target based on ActiveIndex number.

Mode

Values
Name Value Description
AtIndexOnly 0 Activates only item at ActiveIndex.
AllButIndex 1 Activates all items except the one at ActiveIndex which will be disabled.
IndexAndBefore 2 Activates all items that are before and at ActiveIndex.
IndexAndAfter 3 Activates all items at and after ActiveIndex

Usage

Examples

Related Issues

See Also