鼠标单双击判断

来源:互联网 发布:网络剧一般在哪招演员 编辑:程序博客网 时间:2024/04/30 15:57
void OnMouseUp()
{
float currentTime = Time.time;
Vector3 currentpos= Input .mousePosition;


if(currentTime - OldTime <=TimeLimit &&Vector3.Distance( currentpos , OldPos) <= DisLimit)
{
//双击
}else
{
//单击
}
OldPos = currentpos;
OldTime = currentTime;

}
0 0
原创粉丝点击