Event.mousePosition 鼠标位置

var mousePosition : Vector2

Description描述

The mouse position.

鼠标的位置。

Used in EventType.MouseMove and EventType.MouseDrag events.

EventType.MouseMoveEventType.MouseDrag事件中使用。

参见:Event.delta.

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnGUI() {
		Event e = Event.current;
		Debug.Log(e.mousePosition);
	}
}
// Prints the current mouse position
//打印当前的鼠标位置
function OnGUI () {
	var e : Event = Event.current;
	Debug.Log(e.mousePosition);
}
Page last updated: 2010-12-31