Input
- accelerationEventCount
- accelerationEvents
- acceleration
- anyKeyDown
- anyKey
- compositionCursorPos
- compositionString
- deviceOrientation
- eatKeyPressOnTextFieldFocus
- GetAccelerationEvent
- GetAxisRaw
- GetAxis
- GetButtonDown
- GetButtonUp
- GetButton
- GetJoystickNames
- GetKeyDown
- GetKeyUp
- GetKey
- GetMouseButtonDown
- GetMouseButtonUp
- GetMouseButton
- GetPosition
- GetRotation
- GetTouch
- gyro
- imeCompositionMode
- inputString
- isGyroAvailable
- mousePosition
- multiTouchEnabled
- ResetInputAxes
- touchCount
- touches
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");
}
最后修改:2011年3月11日 Friday 18:33