Event.shift 键盘Shift键

var shift : bool

Description描述

Is Shift held down? (Read Only)

Shift键按住了么(只读)?

Returns true if any Shift key is held down.

如果Shift键被按住返回真。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnGUI() {
		Event e = Event.current;
		if (e.shift)
			Debug.Log("Shift was pressed :O");

	}
}
// Detects if the shift key was pressed
//检测如果shift键被按住
function OnGUI() {
	var e : Event = Event.current;
	if (e.shift) {
		Debug.Log("Shift was pressed :O");
	}
}
Page last updated: 2010-12-31