Event.delta 增量

var delta : Vector2

Description描述

The relative movement of the mouse compared to last event.

相对于上次事件,鼠标的相对移动。

Used in EventType.MouseMove, EventType.MouseDrag, EventType.ScrollWheel events.

EventType.MouseMoveEventType.MouseDragEventType.ScrollWheel事件中使用。

参见:Event.mousePosition.

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnGUI() {
		Event e = Event.current;
		if (e.isMouse)
			Debug.Log(e.delta);

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