Toggler
namespace: qASIC.Toggling
Togglers
Introduction
Togglers are special scripts for toggling objects. They are often used in qASIC to support other input systems.
Creating your own Toggler
If the built in togglers aren't enough, you can create your own. By inheriting the Toggler
or Static Toggler
class you can change how it toggles objects.
public class ExampleToggler : Toggler
{
[KeyCodeListener] public KeyCode key;
protected override void HandleInput()
{
if (Input.GetKeyDown(key))
KeyToggle();
}
}
Toggler types
Type | Description |
---|---|
Toggler | Base toggler that stays in the scene. |
Static Toggler | Toggler that moves from scene to scene. |
Built in Togglers
Toggler | Description |
---|---|
Toggler Basic | Normal Toggler that uses KeyCodes. Works with the new Unity Input System. |
Toggler Remappable | Toggler that works with the qASIC Input System, where you can remap the button in game. |
Static Toggler Basic | Toggler Basic that moves from scene to scene. |
Static Toggler Remappable | Toggler Remappable that moves from scene to scene. |
Toggler controllers
Introduction
These scripts are responsible for activating and controlling togglers.
Setup
Before you can use it, you'll have to make sure all of the togglers which will be used by the controller are set to the Module
mode.
Built in toggler controllers
Toggler Controller | Description |
---|---|
Platform Toggler Controller | This controller uses a different toggler for different platforms. The most common use case for it is changing the pause menu key on WebGL, because the industry standard Escape minimizes the player instead of pausing. |