Event.isMouse 鼠标事件?

var isKey : bool

Description描述

Is this event a mouse event? (Read Only)

这个事件是鼠标事件么(只读)?

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnGUI() {
		Event e = Event.current;
		if (e.isMouse)
			Debug.Log("Detected a mouse event!");

	}
}
// Detects any mouse event
//检测任意鼠标事件
function OnGUI() {
	var e : Event = Event.current;
	if (e.isMouse){
		Debug.Log("Detected a mouse event!");
	}
}
Page last updated: 2010-12-31