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.deviceOrientation 设备方向
static var deviceOrientation : DeviceOrientation
Description描述
Device physical orientation as reported by OS (Read Only).
操作系统所报告的物理设备的方位信息(只读)
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void Update() {
if (Input.deviceOrientation == DeviceOrientation.FaceDown)
audio.Play();
}
}
// Play a sound if screen is facing downwards
//如果屏幕朝下,播放声音
function Update () {
if (Input.deviceOrientation == DeviceOrientation.FaceDown)
audio.Play();
}
最后修改:2011年3月30日 Wednesday 14:33