Unity 5.0 から「UnityEngine.iOS.Device」が追加されました
このクラスを使用することでアプリが動作しているiOS端末の
世代やバージョンなどの情報を取得できます
using UnityEngine; using UnityEngine.iOS; public class ExampleClass : MonoBehaviour { private void Awake() { Debug.Log( "" + Device.advertisingIdentifier ); Debug.Log( "" + Device.advertisingTrackingEnabled ); Debug.Log( "" + Device.generation ); Debug.Log( "" + Device.systemVersion ); Debug.Log( "" + Device.vendorIdentifier ); } }
| プロパティ | 説明 |
|---|---|
| advertisingIdentifier | 広告 ID |
| advertisingTrackingEnabled | 広告の追跡が可能かどうか |
| generation | デバイスの世代 |
| systemVersion | OS のバージョン |
| vendorIdentifier | ベンダー ID |
iPhone 6 Plus で試してみる
| プロパティ | 値 |
|---|---|
| advertisingIdentifier | XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX |
| advertisingTrackingEnabled | True |
| generation | iPhone6Plus |
| systemVersion | 8.1.3 |
| vendorIdentifier | XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX |
参考サイト様