unity c#实现鼠标双击
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;
}
}