- 最后登录
- 2021-4-13
- 注册时间
- 2013-7-5
- 阅读权限
- 50
- 积分
- 1154
- 纳金币
- 31
- 精华
- 0
|
挣一点金币- public class test : MonoBehaviour
- {
- public float doubeClickDelay = 0.4f;
- bool firstClick = false;
- bool secondClick = false;
- float firstClickTime;
- float secondClickTime;
-
- // Use this for initialization
- void Start()
- {
-
- }
-
- // Update is called once per frame
- void Update()
- {
-
- if (Time.time - firstClickTime > doubeClickDelay)
- {
- firstClick = false;
- secondClick = false;
- }
- }
-
- void OnMouseUp()
- {
- print("up!!");
- if (firstClick == false)
- {
- firstClick = true;
-
- firstClickTime = Time.time;
- return;
- }
- if (firstClick)
- {
- secondClick = true;
- secondClickTime = Time.time;
-
- print("double Click!!!!!!!!!!");
- }
-
- }
- }
复制代码 |
-
总评分: 纳金币 + 3
查看全部评分
|