/// <summary> Fire the 'Back' button event (if it can be executed and is enabled) </summary> public void Execute() { if (!DoozySettings.Instance.UseBackButton) { return; } if (!CanExecuteBackButton) { return; } if (BackButtonDisabled) { return; } if (UIPopup.AnyPopupVisible) { UIPopup lastShownPopup = UIPopup.LastShownPopup; if (lastShownPopup.HideOnBackButton) { lastShownPopup.Hide(); } if (lastShownPopup.BlockBackButton) { return; } } if (UIDrawer.AnyDrawerOpened) { UIDrawer openedDrawer = UIDrawer.OpenedDrawer; if (openedDrawer.HideOnBackButton) { openedDrawer.Close(); } if (openedDrawer.BlockBackButton) { return; } } Message.Send(new UIButtonMessage(NAME, UIButtonBehaviorType.OnClick)); m_lastBackButtonPressTime = Time.realtimeSinceStartup; }
private void ExecuteActions() { // ReSharper disable once SwitchStatementMissingSomeCases switch (Action) { case DrawerAction.Open: UIDrawer.Open(DrawerName, DebugMode); break; case DrawerAction.Close: UIDrawer.Close(DrawerName, DebugMode); break; case DrawerAction.Toggle: UIDrawer.Toggle(DrawerName, DebugMode); break; } }