Escape or Back event
Inheritance: MonoBehaviour
Example #1
0
    private void Escape(EscapeEvent e)
    {
        if (e.CurrentSceneIndex != SceneManager.GetActiveScene().buildIndex)
        {
            return;
        }

        LoadSceneManager.instance.PreviousSceneLoad();
    }
Example #2
0
 private void Escape(EscapeEvent e)
 {
     if (settingPanel != null && settingPanel.activeSelf)
     {
         SettingUpdate();
         settingPanel.SetActive(false);
         return;
     }
     Application.Quit();
 }
    public bool Invoke()
    {
        var e = new EscapeEvent();

        for (int i = _listeners.Count - 1; i >= 0; i++)
        {
            _listeners[i].Invoke(e);
            if (e.Handled)
            {
                return(true);
            }
        }

        return(false);
    }
 private void HandleEscapePress(EscapeEvent e)
 {
     gameObject.SetActive(false);
     e.SetHandled();
 }