float t;
float t1;
void Update () {
if (Input.GetMouseButtonDown(0))
{
t1 = Time.realtimeSinceStartup;
if (t1 - t < 0.5f)
{
Debug.Log("双击");
}
t = t1;
}
}
float t;
float t1;
void Update () {
if (Input.GetMouseButtonDown(0))
{
t1 = Time.realtimeSinceStartup;
if (t1 - t < 0.5f)
{
Debug.Log("双击");
}
t = t1;
}
}
转载于:https://www.cnblogs.com/lzl0823/p/6516731.html