Unity 鼠标双击
来源:互联网 发布:老板的红颜知已 编辑:程序博客网 时间:2024/04/30 08:57
using UnityEngine;using System.Collections;public class SlideScreen : MonoBehaviour{ bool one_click = false; bool timer_running; float timer_for_double_click; float delay; //public Vector3 position; void Start() { } // Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0)) { if (!one_click) // first click no previous clicks { one_click = true; timer_for_double_click = Time.time; // save the current time // do one click things; } else { one_click = false; // found a double click, now reset //do double click things } } if (one_click) { // if the time now is delay seconds more than when the first click started. if ((Time.time - timer_for_double_click) > delay) { //basically if thats true its been too long and we want to reset so the next click is simply a single click and not a double click. one_click = false; } } }}
阅读全文
0 0
- unity鼠标双击
- Unity 鼠标双击
- unity鼠标双击
- Unity鼠标双击事件
- unity鼠标单击双击事件
- 【Unity】怎么判断鼠标双击
- Unity 鼠标双击事件检测
- Unity: Unity3D 模拟鼠标单击/双击
- 关于unity的鼠标双击和移动触摸屏的双击
- 关于unity的鼠标双击和移动触摸屏的双击
- unity的鼠标双击和移动触摸屏的双击
- 【Unity实用小方法】鼠标双击的判断
- 鼠标双击
- Java鼠标双击事件
- Java鼠标双击事件
- 另一种鼠标双击事件
- 判断鼠标双击
- 鼠标双击事件
- jQuery常用方法
- 数字相关知识
- 【整理】单元测试与功能测试的区别
- Libevent源码分析-----配置event_base
- 292. Nim Game
- Unity 鼠标双击
- Android中的Apk的加固(加壳)原理解析和实现
- mean.npy的生成方法
- Examnation 20170606 T2 prob
- 业余时间你在做什么,你就会变成什么样的人?
- MySQL中‘grand‘的用法
- floodlight控制器探测拓扑结构
- Libevent源码分析-----跨平台Reactor接口的实现
- JAVA三大特性