Event.clickCount 鼠标点击数

var clickCount : int

Description描述

How many consecutive mouse clicks have we received.

我们收到的鼠标连续点击多少次。

Used in EventType.MouseDown event; use this to differentiate between a single and double clicks.

EventType.MouseDown事件使用。使用这个不同于单击和双击。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnGUI() {
	Event e = Event.current;
	if (e.isMouse)
		Debug.Log("Mouse clicks: " + e.clickCount);

	}
}
function OnGUI() {
	var e : Event = Event.current;
	if (e.isMouse) {
		Debug.Log("Mouse clicks: " + e.clickCount);
	}
}
Page last updated: 2010-12-31