how we exit of my project with twice pressing back button???

Hi guys, i want to main scene my project with twice pressing back button mobile exit it
for in work i use of code Input.GetKey (KeyCode.Escape) but this code with once pressing my project exit.
does anyone know a way to give???
Thank you

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;
}

You can start a small timer that counts the time from one Input.GetKey (KeyCode.Escape) to the next.
if the exit key was pressed twice inside your designated time exit the application, if not do not exit.

Thanks to all friends