[ Unity 3D ] On Double Back Button Clicked Android | Escape Button

uint exitCount = 0;
    void Update()
    {
        if (Input.GetKeyUp(KeyCode.Escape))
        {
            exitCount++;
           
            if (!IsInvoking("disableDoubleClick"))
                Invoke("disableDoubleClick", 0.3f);
        }
        if (exitCount == 2)
        {
            CancelInvoke("disableDoubleClick");
            Application.Quit();
        }
    }

    void disableDoubleClick()
    {
        exitCount = 0;
    }

Comments

  1. The BDG Win colour prediction game is an interesting topic for readers exploring colour-based gaming formats. Explaining the basic rules, potential risks, and unpredictability of outcomes helps users understand the experience without assuming that results can be guaranteed.

    ReplyDelete

Post a Comment

Popular Posts