# デバイスの追加

> Explains how to define a new device to simulate and use it in the Device Simulator.

Device Simulator (デバイスシミュレーター)に新しいデバイスを追加するには、デバイス定義とデバイスオーバーレイを作成します。

デバイス定義は、Unity プロジェクトにあり、`.device` 拡張子を持つテキストファイルです。このファイルには、デバイスのプロパティを記述した JSON が含まれています。

デバイスオーバーレイは、デバイス画面の境界線、ノッチ、パンチアウト、および画面の矩形領域へのその他の追加を含む画像です。任意でデバイス定義と一緒に使用すると、ハードウェア要素がデバイス画面をどのように妨げるかを視覚化し、その結果、タッチ入力がいつ失敗するかを判断することができます。

## デバイス定義の作成

デバイス定義は、デバイスを表す JSON ファイルです。必須のプロパティといくつかの任意のプロパティの両方があります。デバイス定義ファイルにエラーがある場合、ファイルを選択すると Inspector にエラーが表示されます。

### スキーマ

| **プロパティ**        | **必須** | **説明**                                                                                                                                                                            |
| ---------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **friendlyName** | はい     | このデバイスの UI に表示する名前です。                                                                                                                                                             |
| **version**      | はい     | デバイス定義ファイルのバージョンを示します。現在のバージョンは `1` です。                                                                                                                                           |
| **screens**      | はい     | デバイスをシミュレートするための画面をそれぞれ記述したオブジェクトのリスト。これには少なくとも 1 つの screen が含まれていなければなりません。各スクリーンオブジェクトのスキーマについては、[screen](#screen) を参照してください。                                                   |
| **systemInfo**   | はい     | デバイスの能力を記述したオブジェクト。このオブジェクトの値は、[SystemInfo](/engine/6000.0/script-reference/unity-engine/system-info.md) にマップします。systemInfo オブジェクトのスキーマについては、[systemInfo](#systeminfo) を参照してください。 |

#### screen

| **プロパティ**               | **必須** | **説明**                                                                                                                                      |
| ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **width**               | はい     | 画面の幅 (ピクセル単位)。                                                                                                                              |
| **height**              | はい     | 画面の高さ (ピクセル単位)。                                                                                                                             |
| **navigationBarHeight** | いいえ    | 全画面でないときに、一部のデバイスで表示される画面上の Android ナビゲーションバーの高さ (ピクセル単位)。                                                                                  |
| **dpi**                 | はい     | 画面の dpi。                                                                                                                                    |
| **orientations**        | いいえ    | 画面がシミュレートできる向きをそれぞれ記述したオブジェクトのリスト。このプロパティに値を設定しない場合、画面はすべての向きをサポートします。各 orientation オブジェクトのスキーマについては、[orientation](#orientation) を参照してください。 |
| **presentation**        | いいえ    | デバイスのオーバーレイを記述したオブジェクト。このオブジェクトのスキーマについては、[presentation](#presentation) を参照してください。                                                          |

#### orientation

| **プロパティ**       | **必須** | **説明**                                                                                                                    |
| --------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- |
| **orientation** | はい     | 画面の向き。このプロパティの値は、[ScreenOrientation](/engine/6000.0/script-reference/unity-engine/screen-orientation.md) enum にマップする数値です。 |
| **safeArea**    | いいえ    | 画面のセーフエリアを決定する [Rect](/engine/6000.0/script-reference/unity-engine/rect.md)。このプロパティに値を設定しないと、シミュレーターは画面全体がセーフであると見なします。   |
| **cutouts**     | いいえ    | コンテンツを表示できない画面のエリアを指定する [Rect](/engine/6000.0/script-reference/unity-engine/rect.md) のリスト。                                |

#### presentation

| **プロパティ**       | **必須** | **説明**                                   |
| --------------- | ------ | ---------------------------------------- |
| **overlayPath** | いいえ    | デバイス定義ファイルから、デバイスのオーバーレイとして使用する画像への相対パス。 |
| **borderSize**  | いいえ    | オーバーレイから画面の開始位置までの距離 (ピクセル単位)。           |

#### systeminfo

このオブジェクトのプロパティでは、デバイスの機能とシステム情報を記述します。システム情報を記述するため、その多くは [SystemInfo](/engine/6000.0/script-reference/unity-engine-device/system-info.md) のプロパティにマップします。

| **プロパティ**                   | **必須** | **説明**                                                                                                                                               |
| --------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| **deviceModel**             | いいえ    | [Device.SystemInfo.deviceModel](/engine/6000.0/script-reference/unity-engine-device/system-info/device-model.md) を参照してください。                          |
| **deviceType**              | いいえ    | [Device.SystemInfo.deviceType](/engine/6000.0/script-reference/unity-engine-device/system-info/device-type.md) を参照してください。                            |
| **operatingSystem**         | はい     | [Device.SystemInfo.operatingSystem](/engine/6000.0/script-reference/unity-engine-device/system-info/operating-system.md) を参照してください。                  |
| **operatingSystemFamily**   | いいえ    | [Device.SystemInfo.operatingSystemFamily](/engine/6000.0/script-reference/unity-engine-device/system-info/operating-system-family.md) を参照してください。     |
| **processorCount**          | いいえ    | [Device.SystemInfo.processorCount](/engine/6000.0/script-reference/unity-engine-device/system-info/processor-count.md) を参照してください。                    |
| **processorFrequency**      | いいえ    | [Device.SystemInfo.processorFrequency](/engine/6000.0/script-reference/unity-engine-device/system-info/processor-frequency.md) を参照してください。            |
| **processorType**           | いいえ    | [Device.SystemInfo.processorType](/engine/6000.0/script-reference/unity-engine-device/system-info/processor-type.md) を参照してください。                      |
| **supportsAccelerometer**   | いいえ    | [Device.SystemInfo.supportsAccelerometer](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-accelerometer.md) を参照してください。      |
| **supportsAudio**           | いいえ    | [Device.SystemInfo.supportsAudio](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-audio.md) を参照してください。                      |
| **supportsGyroscope**       | いいえ    | [Device.SystemInfo.supportsGyroscope](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-gyroscope.md) を参照してください。              |
| **supportsLocationService** | いいえ    | [Device.SystemInfo.supportsLocationService](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-location-service.md) を参照してください。 |
| **supportsVibration**       | いいえ    | [Device.SystemInfo.supportsVibration](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-vibration.md) を参照してください。              |
| **systemMemorySize**        | いいえ    | [Device.SystemInfo.systemMemorySize](/engine/6000.0/script-reference/unity-engine-device/system-info/system-memory-size.md) を参照してください。               |
| **unsupportedIdentifier**   | いいえ    | [Device.SystemInfo.unsupportedIdentifier](/engine/6000.0/script-reference/unity-engine-device/system-info/unsupported-identifier.md) を参照してください。      |
| **graphicsDependentData**   | いいえ    | デバイスがサポートするグラフィックス API をそれぞれに記述したオブジェクトのリスト。各オブジェクトのスキーマについては、[graphicsDependentData](#graphicsdependentdata) を参照してください。                             |

#### graphicsDependentData

オブジェクトのプロパティは、デバイスがサポートするグラフィックス API を記述します。

| **プロパティ**                                           | **必須** | **説明**                                                                                                                                                                                                    |
| --------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **graphicsDeviceType**                              | はい     | [Device.SystemInfo.graphicsDeviceType](/engine/6000.0/script-reference/unity-engine-device/system-info/graphics-device-type.md) を参照してください。                                                                |
| **graphicsMemorySize**                              | いいえ    | [Device.SystemInfo.graphicsMemorySize](/engine/6000.0/script-reference/unity-engine-device/system-info/graphics-memory-size.md) を参照してください。                                                                |
| **graphicsDeviceName**                              | いいえ    | [Device.SystemInfo.graphicsDeviceName](/engine/6000.0/script-reference/unity-engine-device/system-info/graphics-device-name.md) を参照してください。                                                                |
| **graphicsDeviceVendor**                            | いいえ    | [Device.SystemInfo.graphicsDeviceVendor](/engine/6000.0/script-reference/unity-engine-device/system-info/graphics-device-vendor.md) を参照してください。                                                            |
| **graphicsDeviceID**                                | いいえ    | [Device.SystemInfo.graphicsDeviceID](/engine/6000.0/script-reference/unity-engine-device/system-info/graphics-device-id.md) を参照してください。                                                                    |
| **graphicsDeviceVendorID**                          | いいえ    | [Device.SystemInfo.graphicsDeviceVendorID](/engine/6000.0/script-reference/unity-engine-device/system-info/graphics-device-vendor-id.md) を参照してください。                                                       |
| **graphicsUVStartsAtTop**                           | いいえ    | [Device.SystemInfo.graphicsUVStartsAtTop](/engine/6000.0/script-reference/unity-engine-device/system-info/graphics-uv-starts-at-top.md) を参照してください。                                                        |
| **graphicsDeviceVersion**                           | いいえ    | [Device.SystemInfo.graphicsDeviceVersion](/engine/6000.0/script-reference/unity-engine-device/system-info/graphics-device-version.md) を参照してください。                                                          |
| **graphicsShaderLevel**                             | いいえ    | [Device.SystemInfo.graphicsShaderLevel](/engine/6000.0/script-reference/unity-engine-device/system-info/graphics-shader-level.md) を参照してください。                                                              |
| **graphicsMultiThreaded**                           | いいえ    | [Device.SystemInfo.graphicsMultiThreaded](/engine/6000.0/script-reference/unity-engine-device/system-info/graphics-multi-threaded.md) を参照してください。                                                          |
| **renderingThreadingMode**                          | いいえ    | [Device.SystemInfo.renderingThreadingMode](/engine/6000.0/script-reference/unity-engine-device/system-info/rendering-threading-mode.md) を参照してください。                                                        |
| **hasHiddenSurfaceRemovalOnGPU**                    | いいえ    | [Device.SystemInfo.hasHiddenSurfaceRemovalOnGPU](/engine/6000.0/script-reference/unity-engine-device/system-info/has-hidden-surface-removal-on-gpu.md) を参照してください。                                         |
| **hasDynamicUniformArrayIndexingInFragmentShaders** | いいえ    | [Device.SystemInfo.hasDynamicUniformArrayIndexingInFragmentShaders](/engine/6000.0/script-reference/unity-engine-device/system-info/has-dynamic-uniform-array-indexing-in-fragment-shaders.md) を参照してください。 |
| **supportsShadows**                                 | いいえ    | [Device.SystemInfo.supportsShadows](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-shadows.md) を参照してください。                                                                       |
| **supportsRawShadowDepthSampling**                  | いいえ    | [Device.SystemInfo.supportsRawShadowDepthSampling](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-raw-shadow-depth-sampling.md) を参照してください。                                      |
| **supportsMotionVectors**                           | いいえ    | [Device.SystemInfo.supportsMotionVectors](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-motion-vectors.md) を参照してください。                                                          |
| **supports3DTextures**                              | いいえ    | [Device.SystemInfo.supports3DTextures](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-3-d-textures.md) を参照してください。                                                               |
| **supports2DArrayTextures**                         | いいえ    | [Device.SystemInfo.supports2DArrayTextures](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-2-d-array-textures.md) を参照してください。                                                    |
| **supports3DRenderTextures**                        | いいえ    | [Device.SystemInfo.supports3DRenderTextures](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-3-d-render-textures.md) を参照してください。                                                  |
| **supportsCubemapArrayTextures**                    | いいえ    | [Device.SystemInfo.supportsCubemapArrayTextures](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-cubemap-array-textures.md) を参照してください。                                           |
| **copyTextureSupport**                              | いいえ    | [Device.SystemInfo.copyTextureSupport](/engine/6000.0/script-reference/unity-engine-device/system-info/copy-texture-support.md) を参照してください。                                                                |
| **supportsComputeShaders**                          | いいえ    | [Device.SystemInfo.supportsComputeShaders](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-compute-shaders.md) を参照してください。                                                        |
| **supportsGeometryShaders**                         | いいえ    | [Device.SystemInfo.supportsGeometryShaders](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-geometry-shaders.md) を参照してください。                                                      |
| **supportsTessellationShaders**                     | いいえ    | [Device.SystemInfo.supportsTessellationShaders](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-tessellation-shaders.md) を参照してください。                                              |
| **supportsInstancing**                              | いいえ    | [Device.SystemInfo.supportsInstancing](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-instancing.md) を参照してください。                                                                 |
| **supportsHardwareQuadTopology**                    | いいえ    | [Device.SystemInfo.supportsHardwareQuadTopology](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-hardware-quad-topology.md) を参照してください。                                           |
| **supports32bitsIndexBuffer**                       | いいえ    | [Device.SystemInfo.supports32bitsIndexBuffer](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-32-bits-index-buffer.md) を参照してください。                                                |
| **supportsSparseTextures**                          | いいえ    | [Device.SystemInfo.supportsSparseTextures](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-sparse-textures.md) を参照してください。                                                        |
| **supportedRenderTargetCount**                      | いいえ    | [Device.SystemInfo.supportedRenderTargetCount](/engine/6000.0/script-reference/unity-engine-device/system-info/supported-render-target-count.md) を参照してください。                                               |
| **supportsSeparatedRenderTargetsBlend**             | いいえ    | [Device.SystemInfo.supportsSeparatedRenderTargetsBlend](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-separated-render-targets-blend.md) を参照してください。                            |
| **supportedRandomWriteTargetCount**                 | いいえ    | [Device.SystemInfo.supportedRandomWriteTargetCount](/engine/6000.0/script-reference/unity-engine-device/system-info/supported-random-write-target-count.md) を参照してください。                                    |
| **supportsMultisampledTextures**                    | いいえ    | [Device.SystemInfo.supportsMultisampledTextures](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-multisampled-textures.md) を参照してください。                                            |
| **supportsMultisampleAutoResolve**                  | いいえ    | [Device.SystemInfo.supportsMultisampleAutoResolve](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-multisample-auto-resolve.md) を参照してください。                                       |
| **supportsTextureWrapMirrorOnce**                   | いいえ    | [Device.SystemInfo.supportsTextureWrapMirrorOnce](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-texture-wrap-mirror-once.md) を参照してください。                                        |
| **usesReversedZBuffer**                             | いいえ    | [Device.SystemInfo.usesReversedZBuffer](/engine/6000.0/script-reference/unity-engine-device/system-info/uses-reversed-z-buffer.md) を参照してください。                                                             |
| **npotSupport**                                     | いいえ    | [Device.SystemInfo.npotSupport](/engine/6000.0/script-reference/unity-engine-device/system-info/npot-support.md) を参照してください。                                                                               |
| **maxTextureSize**                                  | いいえ    | [Device.SystemInfo.maxTextureSize](/engine/6000.0/script-reference/unity-engine-device/system-info/max-texture-size.md) を参照してください。                                                                        |
| **maxCubemapSize**                                  | いいえ    | [Device.SystemInfo.maxCubemapSize](/engine/6000.0/script-reference/unity-engine-device/system-info/max-cubemap-size.md) を参照してください。                                                                        |
| **maxComputeBufferInputsVertex**                    | いいえ    | [Device.SystemInfo.maxComputeBufferInputsVertex](/engine/6000.0/script-reference/unity-engine-device/system-info/max-compute-buffer-inputs-vertex.md) を参照してください。                                          |
| **maxComputeBufferInputsFragment**                  | いいえ    | [Device.SystemInfo.maxComputeBufferInputsFragment](/engine/6000.0/script-reference/unity-engine-device/system-info/max-compute-buffer-inputs-fragment.md) を参照してください。                                      |
| **maxComputeBufferInputsGeometry**                  | いいえ    | [Device.SystemInfo.maxComputeBufferInputsGeometry](/engine/6000.0/script-reference/unity-engine-device/system-info/max-compute-buffer-inputs-geometry.md) を参照してください。                                      |
| **maxComputeBufferInputsDomain**                    | いいえ    | [Device.SystemInfo.maxComputeBufferInputsDomain](/engine/6000.0/script-reference/unity-engine-device/system-info/max-compute-buffer-inputs-domain.md) を参照してください。                                          |
| **maxComputeBufferInputsHull**                      | いいえ    | [Device.SystemInfo.maxComputeBufferInputsHull](/engine/6000.0/script-reference/unity-engine-device/system-info/max-compute-buffer-inputs-hull.md) を参照してください。                                              |
| **maxComputeBufferInputsCompute**                   | いいえ    | [Device.SystemInfo.maxComputeBufferInputsCompute](/engine/6000.0/script-reference/unity-engine-device/system-info/max-compute-buffer-inputs-compute.md) を参照してください。                                        |
| **maxComputeWorkGroupSize**                         | いいえ    | [Device.SystemInfo.maxComputeWorkGroupSize](/engine/6000.0/script-reference/unity-engine-device/system-info/max-compute-work-group-size.md) を参照してください。                                                    |
| **maxComputeWorkgroupSizeX**                        | いいえ    | [Device.SystemInfo.maxComputeWorkGroupSizeX](/engine/6000.0/script-reference/unity-engine-device/system-info/max-compute-work-group-size-x.md) を参照してください。                                                 |
| **maxComputeWorkGroupSizeY**                        | いいえ    | [Device.SystemInfo.maxComputeWorkGroupSizeY](/engine/6000.0/script-reference/unity-engine-device/system-info/max-compute-work-group-size-y.md) を参照してください。                                                 |
| **maxComputeWorkgroupSizeZ**                        | いいえ    | [Device.SystemInfo.maxComputeWorkGroupSizeZ](/engine/6000.0/script-reference/unity-engine-device/system-info/max-compute-work-group-size-z.md) を参照してください。                                                 |
| **supportsAsyncCompute**                            | いいえ    | [Device.SystemInfo.supportsAsyncCompute](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-async-compute.md) を参照してください。                                                            |
| **supportsGraphicsFence**                           | いいえ    | [Device.SystemInfo.supportsGraphicsFence](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-graphics-fence.md) を参照してください。                                                          |
| **supportsAsyncGPUReadback**                        | いいえ    | [Device.SystemInfo.supportsAsyncGPUReadback](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-async-gpu-readback.md) を参照してください。                                                   |
| **supportsParallelPSOCreation**                     | いいえ    | [Device.SystemInfo.supportsParallelPSOCreation](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-parallel-pso-creation.md) を参照してください。                                             |
| **supportsRayTracing**                              | いいえ    | [Device.SystemInfo.supportsRayTracing](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-ray-tracing.md) を参照してください。                                                                |
| **supportsRayTracingShaders**                       | いいえ    | [Device.SystemInfo.supportsRayTracingShaders](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-ray-tracing-shaders.md) を参照してください。                                                 |
| **supportsInlineRayTracing**                        | いいえ    | [Device.SystemInfo.supportsInlineRayTracing](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-inline-ray-tracing.md) を参照してください。                                                   |
| **SupportSetConstantBuffer**                        | いいえ    | [Device.SystemInfo.supportsSetConstantBuffer](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-set-constant-buffer.md) を参照してください。                                                 |
| **hasMipMaxLevel**                                  | いいえ    | [Device.SystemInfo.hasMipMaxLevel](/engine/6000.0/script-reference/unity-engine-device/system-info/has-mip-max-level.md) を参照してください。                                                                       |
| **supportsMipStreaming**                            | いいえ    | [Device.SystemInfo.supportsMipStreaming](/engine/6000.0/script-reference/unity-engine-device/system-info/supports-mip-streaming.md) を参照してください。                                                            |
| **usesLoadStoreActions**                            | いいえ    | [Device.SystemInfo.usesLoadStoreActions](/engine/6000.0/script-reference/unity-engine-device/system-info/uses-load-store-actions.md) を参照してください。                                                           |

#### 最低限のデバイス定義

以下のデバイス定義には、すべての必須プロパティが含まれ、任意のプロパティは含まれていません。これは、最低限のデバイス定義です。

**ノート**: このデバイス定義は向きのデータを提供しないため、シミュレーターはデバイスがすべての向きをサポートし、セーフエリアが画面全体を覆っていると仮定します。

```lang-json
{
    "friendlyName": "Minimal Device",
    "version": 1,
    "screens": [
        {
            "width": 1080,
            "height": 1920,
            "dpi": 450.0
        }
    ],
    "systemInfo": {
        "operatingSystem": "Android"
    }
}
```

#### 完全なデバイス定義

以下のデバイス定義には、すべての必須および任意のプロパティが含まれています。

```lang-json
{
    "friendlyName": "Apple iPhone XR",
    "version": 1,
    "screens": [
        {
            "width": 828,
            "height": 1792,
            "navigationBarHeight": 0,
            "dpi": 326.0,
            "orientations": [
                {
                    "orientation": 1,
                    "safeArea": {
                        "serializedVersion": "2",
                        "x": 0.0,
                        "y": 68.0,
                        "width": 828.0,
                        "height": 1636.0
                    },
                    "cutouts": [
                        {
                            "serializedVersion": "2",
                            "x": 184.0,
                            "y": 1726.0,
                            "width": 460.0,
                            "height": 66.0
                        }
                    ]
                },
                {
                    "orientation": 3,
                    "safeArea": {
                        "serializedVersion": "2",
                        "x": 88.0,
                        "y": 42.0,
                        "width": 1616.0,
                        "height": 786.0
                    },
                    "cutouts": [
                        {
                            "serializedVersion": "2",
                            "x": 0.0,
                            "y": 184.0,
                            "width": 66.0,
                            "height": 460.0
                        }
                    ]
                },
                {
                    "orientation": 4,
                    "safeArea": {
                        "serializedVersion": "2",
                        "x": 88.0,
                        "y": 42.0,
                        "width": 1616.0,
                        "height": 786.0
                    },
                    "cutouts": [
                        {
                            "serializedVersion": "2",
                            "x": 1726.0,
                            "y": 184.0,
                            "width": 66.0,
                            "height": 460.0
                        }
                    ]
                }
            ],
            "presentation": {
                "overlayPath": "Apple iPhone 11_Overlay.png",
                "borderSize": {
                    "x": 51.0,
                    "y": 51.0,
                    "z": 51.0,
                    "w": 51.0
                }
            }
        }
    ],
    "systemInfo": {
        "deviceModel": "iPhone11,8",
        "deviceType": 1,
        "operatingSystem": "iOS 12.0",
        "operatingSystemFamily": 0,
        "processorCount": 6,
        "processorFrequency": 0,
        "processorType": "arm64e",
        "supportsAccelerometer": true,
        "supportsAudio": true,
        "supportsGyroscope": true,
        "supportsLocationService": true,
        "supportsVibration": true,
        "systemMemorySize": 2813,
        "unsupportedIdentifier": "n/a",
        "graphicsDependentData": [
            {
                "graphicsDeviceType": 16,
                "graphicsMemorySize": 1024,
                "graphicsDeviceName": "Apple A12 GPU",
                "graphicsDeviceVendor": "Apple",
                "graphicsDeviceID": 0,
                "graphicsDeviceVendorID": 0,
                "graphicsUVStartsAtTop": true,
                "graphicsDeviceVersion": "Metal",
                "graphicsShaderLevel": 50,
                "graphicsMultiThreaded": true,
                "renderingThreadingMode": 0,
                "hasHiddenSurfaceRemovalOnGPU": true,
                "hasDynamicUniformArrayIndexingInFragmentShaders": true,
                "supportsShadows": true,
                "supportsRawShadowDepthSampling": true,
                "supportsMotionVectors": true,
                "supports3DTextures": true,
                "supports2DArrayTextures": true,
                "supports3DRenderTextures": true,
                "supportsCubemapArrayTextures": true,
                "copyTextureSupport": 31,
                "supportsComputeShaders": true,
                "supportsGeometryShaders": false,
                "supportsTessellationShaders": true,
                "supportsInstancing": true,
                "supportsHardwareQuadTopology": false,
                "supports32bitsIndexBuffer": true,
                "supportsSparseTextures": false,
                "supportedRenderTargetCount": 8,
                "supportsSeparatedRenderTargetsBlend": true,
                "supportedRandomWriteTargetCount": 8,
                "supportsMultisampledTextures": 1,
                "supportsMultisampleAutoResolve": false,
                "supportsTextureWrapMirrorOnce": 0,
                "usesReversedZBuffer": true,
                "npotSupport": 2,
                "maxTextureSize": 16384,
                "maxCubemapSize": 16384,
                "maxComputeBufferInputsVertex": 8,
                "maxComputeBufferInputsFragment": 8,
                "maxComputeBufferInputsGeometry": 0,
                "maxComputeBufferInputsDomain": 8,
                "maxComputeBufferInputsHull": 8,
                "maxComputeBufferInputsCompute": 8,
                "maxComputeWorkGroupSize": 1024,
                "maxComputeWorkGroupSizeX": 1024,
                "maxComputeWorkGroupSizeY": 1024,
                "maxComputeWorkGroupSizeZ": 1024,
                "supportsAsyncCompute": false,
                "supportsGraphicsFence": true,
                "supportsAsyncGPUReadback": true,
                "supportsParallelPSOCreation": true,
                "supportsRayTracing": false,
                "supportsRayTracingShaders": false,
                "supportsInlineRayTracing": false,
                "supportsSetConstantBuffer": true,
                "hasMipMaxLevel": true,
                "supportsMipStreaming": true,
                "usesLoadStoreActions": true,
                "supportedTextureFormats": [1, 2, 3, 4, 5],
                "supportedRenderTextureFormats": [1, 2, 3, 4, 5],
                "ldrGraphicsFormat": 59,
                "hdrGraphicsFormat": 74
            }
        ]
    }
}
```

## デバイスオーバーレイの作成

デバイスオーバーレイは、デバイス画面の境界線と、ノッチ、パンチアウト、および画面の矩形領域へのその他の追加機能を含む画像です。任意でデバイス定義と一緒に使用すると、ハードウェア要素がデバイス画面をどのように妨げるかを視覚化し、その結果、タッチ入力がいつ失敗するかを判断することができます。

デバイスシミュレーターは、透明なピクセルはタップできる画面領域、それ以外の色の不透明なピクセルはハードウェアが妨げる領域と解釈します。テクスチャ自体はどんな形でも構いません。

以下の例では、2 つの iPhone モデルのデバイスオーバーレイを示しています。

**ノート**: デバイスオーバーレイを使用するときの見え方を模倣するため、これらの例では画面のタブを作成する領域に Unity のデフォルトのスカイボックスを表示しています。実際のデバイスオーバーレイでは、これらのピクセルは透明です。

| Apple iPhone 8 オーバーレイ                                                                                     | Apple iPhone XS オーバーレイ                                                                                     |
| --------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| &#xA;**Frame:**&#xA;![](/api/media?file=/engine/6000.0/media/images/device-simulator-overlay-iphone8.png) | &#xA;**Frame:**&#xA;![](/api/media?file=/engine/6000.0/media/images/device-simulator-overlay-iphonexs.png) |

### デバイスオーバーレイの使用

デバイスオーバーレイテクスチャを作成した後に、それをデバイス定義と一緒に使用するには、まずデバイスオーバーレイテクスチャファイルをプロジェクトにインポートする必要があります。

**ノート**: デバイスシミュレーターがデバイスオーバーレイテクスチャをロードするとき、**Read/Write** を有効にしようとします。これができない場合、デバイスシミュレーターはテクスチャを表示しますが、テクスチャを入力のマスクに使用することはできません。つまり、デバイスオーバーレイによってマスクされているべき画面のノッチやその他の領域をクリックすると、入力が検出されます。このようなことが起こらないようにするには、デバイスオーバーレイテクスチャをインポートするときに、Texture Import Settings ウィンドウで **Read/Write** を有効にします。

デバイスオーバーレイテクスチャがプロジェクトにある場合、デバイス定義ファイルを開き、デバイスがサポートする画面を定義するオブジェクトに [presentation](#presentation) プロパティを加えてください。ここで、画像ファイルへのパス (`overlayPath`) と、境界線のサイズ (`borderSize`) を設定します。この方法の例として、以下のデバイス定義ファイルを参照してください。

```lang-json
{
    "friendlyName": "Minimal Device with Overlay",
    "version": 1,
    "screens": [
        {
            "width": 1080,
            "height": 1920,
            "dpi": 450.0,
            "presentation": {
                "overlayPath": "Overlays/MinimalDeviceOverlay.png",
                "borderSize": {
                    "x": 51.0,
                    "y": 51.0,
                    "z": 51.0,
                    "w": 130.0
                }
            }
        }
    ],
    "systemInfo": {
        "operatingSystem": "Android"
    }
}
```

**ノート**: デバイスオーバーレイテクスチャファイルのパスは、デバイス定義ファイルへの相対パス、または Unity プロジェクト内の **Assets** または **Packages** ディレクトリを含むディレクトリへの相対パスです。例えば、デバイス定義ファイルが **Assets/Devices** ディレクトリにあり、デバイスオーバーレイファイルが **Assets/Devices/Overlays** ディレクトリにある場合、以下のファイルパスは両方とも有効です。

* デバイス定義ファイルへの相対パス **Overlays/MinimalDeviceOverlay.png**
* **Assets** ディレクトリを含むディレクトリへの相対パス: **Assets/Devices/Overlays/MinimalDeviceOverlay.png**
