Class BackButton
The ‘Back’ Button functionality injects itself into the Input System and listens for the ‘Cancel’ action. It does that by automatically attaching a Input To Signal to the Event System. This is an automated system that is activated by any UI component in DoozyUI.
Namespace: Doozy.Runtime.UIManager.Input
Assembly: cs.temp.dll.dll
Syntax
public class BackButton : SingletonBehaviour<BackButton>
Fields
k_BackButtonVirtualButtonName
Default name of the virtual button that will be used for the 'Back' button, when LEGACY_INPUT_MANAGER is enabled
Declaration
public const string k_BackButtonVirtualButtonName = "Cancel"
Field Value
Type | Description |
---|---|
String |
k_ButtonName
Default button name for the 'Back' Button
Declaration
public const string k_ButtonName = "Back"
Field Value
Type | Description |
---|---|
String |
k_StreamCategory
Stream category name for the Back Button
Declaration
public const string k_StreamCategory = "Input"
Field Value
Type | Description |
---|---|
String |
k_StreamName
Stream name for the 'Back' Button. Used by stream to listen for the Back Button.
Declaration
public const string k_StreamName = "BackButton"
Field Value
Type | Description |
---|---|
String |
k_StreamNameIgnoreDisabled
Stream name for the 'Back' Button. Used by streamIgnoreDisabled to listen for the 'Back' Button, regardless if the 'Back' button functionality is enabled or not.
Declaration
public const string k_StreamNameIgnoreDisabled = "BackButton.IgnoreDisabledState"
Field Value
Type | Description |
---|---|
String |
k_StreamNameOnDisabled
Stream name for the 'Back' Button. Used by streamOnDisabled to listen for when the 'Back' button functionality was disabled (from the enabled state)
Declaration
public const string k_StreamNameOnDisabled = "BackButton.Disabled"
Field Value
Type | Description |
---|---|
String |
k_StreamNameOnEnabled
Stream name for the 'Back' Button. Used by streamOnEnabled to listen for when the 'Back' button functionality was enabled (from the disabled state)
Declaration
public const string k_StreamNameOnEnabled = "BackButton.Enabled"
Field Value
Type | Description |
---|---|
String |
Properties
canFire
True if the 'Back' button functionality is enabled and is not in cooldown
Declaration
public bool canFire { get; }
Property Value
Type | Description |
---|---|
Boolean |
cooldown
Cooldown after the 'Back' button was fired (to prevent spamming and accidental double execution)
Declaration
public static float cooldown { get; }
Property Value
Type | Description |
---|---|
Single |
hasInput
Flag marked as True if a InputToSignal set to listen for the 'Back' button exists in the scene
Declaration
public bool hasInput { get; }
Property Value
Type | Description |
---|---|
Boolean |
inCooldown
True if the 'Back' button can be triggered again
Declaration
public bool inCooldown { get; }
Property Value
Type | Description |
---|---|
Boolean |
inputSettings
Reference to the UIManager Input Settings
Declaration
public static UIManagerInputSettings inputSettings { get; }
Property Value
Type | Description |
---|---|
UIManagerInputSettings |
isDisabled
True if the 'Back' button functionality is disabled
Declaration
public bool isDisabled { get; }
Property Value
Type | Description |
---|---|
Boolean |
isEnabled
True if the 'Back' button functionality is enabled
Declaration
public bool isEnabled { get; }
Property Value
Type | Description |
---|---|
Boolean |
multiplayerMode
True Multiplayer Mode is enabled
Declaration
public static bool multiplayerMode { get; }
Property Value
Type | Description |
---|---|
Boolean |
stream
Stream that sends signals when the 'Back' button is fired. This stream does not send signals when the 'Back' button is disabled.
Declaration
public static SignalStream stream { get; }
Property Value
Type | Description |
---|---|
SignalStream |
streamIgnoreDisabled
Stream that sends signals when the 'Back' button is fired. This stream sends signals regardless if the 'Back' button is disabled or not.
Declaration
public static SignalStream streamIgnoreDisabled { get; }
Property Value
Type | Description |
---|---|
SignalStream |
streamOnDisabled
Stream that sends signals when the 'Back' button functionality was disabled (from the enabled state)
Declaration
public static SignalStream streamOnDisabled { get; }
Property Value
Type | Description |
---|---|
SignalStream |
streamOnEnabled
Stream that sends signals when the 'Back' button functionality was enabled (from the disabled state)
Declaration
public static SignalStream streamOnEnabled { get; }
Property Value
Type | Description |
---|---|
SignalStream |
Methods
Awake()
Declaration
protected override void Awake()
Overrides
CheckForInput()
Declaration
public void CheckForInput()
Disable()
Disable the 'Back' button functionality
Declaration
public static void Disable()
Enable()
Enable the 'Back' button functionality
Declaration
public static void Enable()
EnableByForce()
Enable the 'Back' button functionality by resetting the additive bool to zero. backButtonDisableLevel = 0. Use this ONLY for special cases when something wrong happens and the back button is stuck in disabled mode.
Declaration
public static void EnableByForce()
Fire()
Execute the 'Back' button event, only if can fire and is enabled. This method is used to simulate a 'Back' button
Declaration
public static void Fire()
Fire(InputSignalData)
Execute the 'Back' button event, only if can fire and is enabled. This method is used to simulate a 'Back' button
Declaration
public static void Fire(InputSignalData data)
Parameters
Type | Name | Description |
---|---|---|
InputSignalData | data |
Initialize()
Declaration
public static void Initialize()
IsDisabled()
True if the 'Back' button functionality is disabled
Declaration
public static bool IsDisabled()
Returns
Type | Description |
---|---|
Boolean |
IsEnabled()
True if the 'Back' button functionality is enabled
Declaration
public static bool IsEnabled()
Returns
Type | Description |
---|---|
Boolean |
OnDestroy()
Declaration
protected override void OnDestroy()