Input.anyKey 任意键?

static var anyKey : bool

Description描述

Is any key or mouse button currently held down? (Read Only)

是否有某一按键或鼠标按钮此时被按住?(只读)

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void Update() {
		if (Input.anyKey)
			Debug.Log("A key or mouse click has been detected");

	}
}
// Detects if any key has been pressed.
//检测是否某一按键被按住

function Update() {
	if(Input.anyKey)
		Debug.Log("A key or mouse click has been detected");
}
Page last updated: 2011-3-11