Version: 2023.1
言語: 日本語
Android 用の開発
Android デバイスの入力

Android モバイルスクリプティング

For cross-platform Projects, use the UNITY_ANDROID define directive to conditionally compile Android-specific C# code. For more information, refer to Platform dependent compilation.

Access device-specific features and properties

Applications can access most features of an Android device through the Input and Handheld classes. For more information, see:

バイブレーションサポート

To trigger a vibration, call Handheld.Vibrate. Devices without vibration hardware ignore this call.

アクティビティインジケーター

Mobile operating systems have built-in activity indicators your application can use during slow operations. For more information, refer to Handheld.StartActivityIndicator.

To access device-specific properties, use these APIs:

スクリプト デバイスプロパティ
SystemInfo.deviceUniqueIdentifier 常に ANDROID_ID の md5 を返します。詳細については、Android デベロッパードキュメントの ANDROID_ID を参照してください。
SystemInfo.deviceName デバイス名を返します。Android デバイスの場合、Unity は安全なシステム設定から device_namebluetooth_name を読み取ろうとします。これらの文字列に値がない場合、Unity は <unknown> を返します。
SystemInfo.deviceModel デバイスモデルを返します。多くの場合、これには製造社名とモデル番号が含まれます (例えば、“LGE Nexus 5 や ”SAMSUNG-SM-G900A" など)。
SystemInfo.operatingSystem オペレーティングシステムの名前とバージョンを返します。
Android 用の開発
Android デバイスの入力