首页 > 代码库 > [Unity菜鸟] Unity鼠标双击,鼠标函数整理(未完)

[Unity菜鸟] Unity鼠标双击,鼠标函数整理(未完)

1. 鼠标双击

?
1
2
3
4
5
6
7
8
9
void OnGUI()
   {
       Event Mouse = Event.current;
       if (Mouse.isMouse && Mouse.type == EventType.MouseDown && Mouse.clickCount == 2)
       {
           // 调用你的函数
           print("Double Click");
       }
   }