unity c#实现鼠标双击

    float t;

    float t1;

    void Update () {

            if (Input.GetMouseButtonDown(0))      

           {

            t1 = Time.realtimeSinceStartup;

            if (t1 - t < 0.5f)

            {

                Debug.Log("双击");

            }           

            t = t1;       

  }

}

posted @ 2017-03-07 20:44  咸鱼翻身记  阅读(2269)  评论(0)    收藏  举报