기기 추가
시뮬레이션할 새 기기를 정의하고 기기 시뮬레이터에서 사용하는 방법을 설명합니다.
읽는 시간 9분최근 업데이트: 10일 전
기기 시뮬레이터에 새 기기를 추가하려면 기기 정의와 기기 오버레이를 생성합니다.
디바이스 정의는 Unity 프로젝트의 확장자가 있는 텍스트 파일입니다. 기기의 프로퍼티를 설명하는 JSON이 포함되어 있습니다.
.device기기 오버레이는 기기 화면의 테두리와 함께 노치, 펀치아웃, 기타 화면 사각형에 추가된 것을 포함하는 이미지입니다. 필요에 따라 기기 정의와 함께 사용하여 하드웨어 요소가 기기 화면을 방해하는 방식을 시각화하고 그 결과 터치 입력이 실패하는 시점을 결정할 수 있습니다.
기기 정의 생성
기기 정의는 기기를 나타내는 JSON 파일입니다. 필수 프로퍼티와 일부 선택적 프로퍼티가 있습니다. 기기 정의 파일에 오류가 포함된 경우 해당 파일을 선택하면 인스펙터에 오류가 표시됩니다.
"schema": "",
프로퍼티 | 필수 여부 | 설명 |
|---|---|---|
| friendlyName | 예 | 이 기기의 UI에 표시할 이름입니다. |
| version | 예 | 기기 정의 파일의 버전을 나타냅니다. 현재 버전은 |
| 화면 | 예 | 각각 기기를 시뮬레이션할 화면을 설명하는 오브젝트 리스트입니다. 화면 하나 이상 포함되어야 합니다. 각 화면 객체의 스키마에 대한 자세한 내용은 화면을 참조하십시오. |
| systemInfo | 예 | 기기의 기능을 설명하는 오브젝트입니다. 이 오브젝트의 값은 SystemInfo에 매핑됩니다. systemInfo 객체의 스키마에 대한 자세한 내용은 systemInfo를 참조하십시오. |
화면
프로퍼티 | 필수 여부 | 설명 |
|---|---|---|
| width | 예 | 화면의 너비(픽셀 단위)입니다. |
| 높이 | 예 | 화면의 높이(픽셀 단위)입니다. |
| navigationBarHeight | 지원 안 함 | 전체 화면이 아니면 일부 기기에서 표시되는 화면 Android 내비게이션 바의 높이(픽셀 단위)입니다. |
| dpi | 예 | 화면의 dpi입니다. |
| 방향 | 지원 안 함 | 각각 화면이 시뮬레이션할 수 있는 방향을 설명하는 오브젝트 리스트입니다. 이 프로퍼티에 대한 값을 설정하지 않으면 화면이 모든 방향을 지원합니다. 각 방향 오브젝트의 스키마에 대한 자세한 내용은 방향을 참조하십시오. |
| 프레젠테이션 | 지원 안 함 | 기기 오버레이를 설명하는 오브젝트입니다. 이 오브젝트의 스키마에 대한 자세한 내용은 표시를 참조하십시오. |
orientation:
프로퍼티 | 필수 여부 | 설명 |
|---|---|---|
| orientation: | 예 | 화면 방향입니다. 이 프로퍼티의 값은 ScreenOrientation 열거형에 매핑되는 숫자입니다. |
| safeArea | 지원 안 함 | 화면의 안전한 영역을 결정하는 사각 영역입니다. 이 프로퍼티에 대한 값을 설정하지 않으면 시뮬레이터는 화면 전체가 안전하다고 가정합니다. |
| cutouts | 지원 안 함 | 콘텐츠 표시에 사용할 수 없는 화면 영역을 지정하는 사각 영역 목록입니다. |
프레젠테이션
프로퍼티 | 필수 여부 | 설명 |
|---|---|---|
| overlayPath | 지원 안 함 | 기기 정의 파일에서 기기 오버레이로 사용할 이미지까지의 상대 경로입니다. |
| borderSize | 지원 안 함 | 오버레이에서 화면 시작 지점까지의 거리(픽셀 단위)입니다. |
systeminfo
이 오브젝트의 프로퍼티는 기기의 기능과 시스템 정보를 설명합니다. 시스템 정보를 설명하기 때문에 대부분은 SystemInfo의 프로퍼티에 매핑됩니다.
프로퍼티 | 필수 여부 | 설명 |
|---|---|---|
| deviceModel | 지원 안 함 | Device.SystemInfo.deviceModel을 참조하십시오. |
| deviceType | 지원 안 함 | Device.SystemInfo.deviceType을 참조하십시오. |
| operatingSystem | 예 | Device.SystemInfo.operatingSystem을 참조하십시오. |
| operatingSystemFamily | 지원 안 함 | Device.SystemInfo.operatingSystemFamily를 참조하십시오. |
| processorCount | 지원 안 함 | Device.SystemInfo.processorCount를 참조하십시오. |
| processorFrequency | 지원 안 함 | Device.SystemInfo.processorFrequency를 참조하십시오. |
| processorType | 지원 안 함 | Device.SystemInfo.processorType을 참조하십시오. |
| supportsAccelerometer | 지원 안 함 | Device.SystemInfo.supportsAccelerometer를 참조하십시오. |
| supportsAudio | 지원 안 함 | Device.SystemInfo.supportsAudio를 참조하십시오. |
| supportsGyroscope | 지원 안 함 | Device.SystemInfo.supportsGyroscope를 참조하십시오. |
| supportsLocationService | 지원 안 함 | Device.SystemInfo.supportsLocationService를 참조하십시오. |
| supportsVibration | 지원 안 함 | Device.SystemInfo.supportsVibration을 참조하십시오. |
| systemMemorySize | 지원 안 함 | Device.SystemInfo.systemMemorySize를 참조하십시오. |
| unsupportedIdentifier | 지원 안 함 | Device.SystemInfo.unsupportedIdentifier를 참조하십시오. |
| graphicsDependentData | 지원 안 함 | 각각 기기가 지원하는 그래픽스 API를 설명하는 오브젝트 리스트입니다. 각 객체의 스키마에 대한 자세한 내용은 graphicsDependentData를 참조하십시오. |
graphicsDependentData
오브젝트의 프로퍼티는 기기가 지원하는 그래픽스 API 설명합니다.
최소한의 디바이스 정의
다음 기기 정의에는 모든 필수 프로퍼티가 포함되며, 선택적 프로퍼티는 포함되지 않습니다. 이는 사용할 수 있는 최소 디바이스 정의입니다.
{ "friendlyName": "Minimal Device", "version": 1, "screens": [ { "width": 1080, "height": 1920, "dpi": 450.0 } ], "systemInfo": { "operatingSystem": "Android" }}
완전한 기기 정의
다음 기기 정의에는 모든 필수 및 선택적 프로퍼티가 포함되어 있습니다.
{ "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 } ] }}
기기 오버레이 생성
기기 오버레이는 기기 화면의 테두리와 노치, 펀치아웃, 화면 사각형에 추가되는 기타 기능을 포함하는 이미지입니다. 필요에 따라 기기 정의와 함께 사용하여 하드웨어 요소가 기기 화면을 방해하는 방식을 시각화하고 그 결과 터치 입력이 실패하는 시점을 결정할 수 있습니다.
기기 시뮬레이터는 투명한 픽셀을 탭할 수 있는 화면 영역으로 해석하고 다른 컬러의 불투명한 픽셀을 하드웨어가 방해하는 영역으로 해석합니다. 텍스처 자체는 어떤 모양일 수도 있습니다.
다음 예시는 두 iPhone 모델의 디바이스 오버레이를 보여줍니다.
Apple iPhone 8 오버레이 | Apple iPhone XS 오버레이 |
|---|---|
![]() | ![]() |
기기 오버레이 사용
기기 오버레이 텍스처를 생성한 후 기기 정의와 함께 사용하려면 먼저 기기 오버레이 텍스처 파일을 프로젝트로 임포트해야 합니다.
기기 오버레이 텍스처가 프로젝트에 있으면 기기 정의 파일을 열고 기기가 지원하는 화면을 정의하는 오브젝트에 프레젠테이션 프로퍼티를 추가합니다. 여기서 이미지 파일의 경로()와 테두리 크기()를 설정합니다. 이를 수행하는 방법에 대한 예시는 다음 기기 정의 파일을 참조하십시오.
overlayPathborderSize{ "friendlyName": "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" }}
- 기기 정의 파일과 관련된 내용: Overlays/MinimalDeviceOverlay.png
- Assets 디렉토리를 포함하는 디렉토리에 상대: Assets/Devices/Overlays/MinimalDeviceOverlay.png

