using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class KeyListener : MonoBehaviour
{

    // Use this for initialization
    void Start()
    {

    }

    bool couldClick = true;
    // Update is called once per frame
    void Update()
    {

        if (Game.Instance == null)
            return;


        if (couldClick && Input.GetKey(KeyCode.Escape))
        {
            Debug.Log("escape!");
            couldClick = false;
            Invoke("ResetClick", 0.5f);

            /*Game.Instance.ShowNoticePanelWithTwoBtn("确定退出游戏吗？", () =>//退出//退出//确定退出游戏吗？
            {
                Application.Quit();
            },null);*/
            
        }
    }

    private void ResetClick()
    {
        couldClick = true;
    }
}

