Next: Mouse Over Toggle, Previous: Holo Text, Up: Interaction [Contents][Index]
This component allows objects, colliders, renderers, and scripts to be toggled based on the state of a given key. Off key is read on key up, On key is read on key down. This prevents key collisions when using the same key for both. If you want these objects and components to start in a ’Toggled off’ state, set ’Toggle’ to false, otherwise they will be enabled automatically when the game starts. It may be more convenient to use this component than using a Message Toggle and Key Message in some situations.
GameObject[] gameObjectTargetsGame Objects we will toggle
MonoBehaviour[] scriptTargetsScripts we will toggle
Collider colliderTargetCollider we will toggle
MeshRenderer rendererTargetRender we will toggle
KeyCode offKey to be pressed to toggle off
Default value: KeyCode.LeftControl
KeyCode onKey to be released to toggle on
Default value: KeyCode.LeftControl
KeyCode swapKeyKey to be tapped to swap the toggle
Default value: KeyCode.None
bool reverseShould we swap off/on?
Default value: false
bool toggleAre we currently toggled?
Default value: true
GameObject[] gameObjectTargetsGame Objects we will toggle
MonoBehaviour[] scriptTargetsScripts we will toggle
Collider colliderTargetCollider we will toggle
MeshRenderer rendererTargetRender we will toggle
KeyCode offKey to be pressed to toggle off
Default value: KeyCode.LeftControl
KeyCode onKey to be released to toggle on
Default value: KeyCode.LeftControl
KeyCode swapKeyKey to be tapped to swap the toggle
Default value: KeyCode.None
bool reverseShould we swap off/on?
Default value: false
bool toggleAre we currently toggled?
Default value: true
Next: Mouse Over Toggle, Previous: Holo Text, Up: Interaction [Contents][Index]