기술 자료

Unity 엔진

Unity 엔진

기기 추가

시뮬레이션할 새 기기를 정의하고 기기 시뮬레이터에서 사용하는 방법을 설명합니다.
읽는 시간 9분최근 업데이트: 10일 전

기기 시뮬레이터에 새 기기를 추가하려면 기기 정의와 기기 오버레이를 생성합니다.
디바이스 정의는 Unity 프로젝트의
.device
확장자가 있는 텍스트 파일입니다. 기기의 프로퍼티를 설명하는 JSON이 포함되어 있습니다.
기기 오버레이는 기기 화면의 테두리와 함께 노치, 펀치아웃, 기타 화면 사각형에 추가된 것을 포함하는 이미지입니다. 필요에 따라 기기 정의와 함께 사용하여 하드웨어 요소가 기기 화면을 방해하는 방식을 시각화하고 그 결과 터치 입력이 실패하는 시점을 결정할 수 있습니다.
참고
Unity 일반적인 화면 특성(예: 노치 스타일, 펀치 구멍 포지션, 화면 크기 등)을 나타내는 빌트인 기기 정의가 포함되어 있습니다. 레이아웃과 상호작용 패턴을 테스트하는 데 사용됩니다. 프로덕션 테스트를 위해 실제 타겟 디바이스에서 항상 애플리케이션을 검증하는 것이 좋습니다.

기기 정의 생성

기기 정의는 기기를 나타내는 JSON 파일입니다. 필수 프로퍼티와 일부 선택적 프로퍼티가 있습니다. 기기 정의 파일에 오류가 포함된 경우 해당 파일을 선택하면 인스펙터에 오류가 표시됩니다.

"schema": "",

프로퍼티

필수 여부

설명

friendlyName예이 기기의 UI에 표시할 이름입니다.
version예기기 정의 파일의 버전을 나타냅니다. 현재 버전은
1
입니다.
화면예각각 기기를 시뮬레이션할 화면을 설명하는 오브젝트 리스트입니다. 화면 하나 이상 포함되어야 합니다. 각 화면 객체의 스키마에 대한 자세한 내용은 화면을 참조하십시오.
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 설명합니다.

프로퍼티

필수 여부

설명

graphicsDeviceType예Device.SystemInfo.graphicsDeviceType을 참조하십시오.
graphicsMemorySize지원 안 함See Device.SystemInfo.graphicsMemorySize.
graphicsDeviceName지원 안 함Device.SystemInfo.graphicsDeviceName을 참조하십시오.
graphicsDeviceVendor지원 안 함See Device.SystemInfo.graphicsDeviceVendor.
graphicsDeviceID지원 안 함See Device.SystemInfo.graphicsDeviceID.
graphicsDeviceVendorID지원 안 함See Device.SystemInfo.graphicsDeviceVendorID.
graphicsUVStartsAtTop지원 안 함Device.SystemInfo.graphicsUVStartsAtTop을 참조하십시오.
graphicsDeviceVersion지원 안 함Device.SystemInfo.graphicsDeviceVersion을 참조하십시오.
graphicsShaderLevel지원 안 함See Device.SystemInfo.graphicsShaderLevel.
graphicsMultiThreaded지원 안 함Device.SystemInfo.graphicsMultiThreaded를 참조하십시오.
renderingThreadingMode지원 안 함Device.SystemInfo.renderingThreadingMode를 참조하십시오.
hasHiddenSurfaceRemovalOnGPU지원 안 함See Device.SystemInfo.hasHiddenSurfaceRemovalOnGPU.
hasDynamicUniformArrayIndexingInFragmentShaders지원 안 함See Device.SystemInfo.hasDynamicUniformArrayIndexingInFragmentShaders.
supportsShadows지원 안 함Device.SystemInfo.supportsShadows를 참조하십시오.
supportsRawShadowDepthSampling지원 안 함Device.SystemInfo.supportsRawShadowDepthSampling을 참조하십시오.
supportsMotionVectors지원 안 함Device.SystemInfo.supportsMotionVectors를 참조하십시오.
supports3DTextures지원 안 함Device.SystemInfo.supports3DTextures를 참조하십시오.
supports2DArrayTextures지원 안 함Device.SystemInfo.supports2DArrayTextures를 참조하십시오.
supports3DRenderTextures지원 안 함Device.SystemInfo.supports3DRenderTextures를 참조하십시오.
supportsCubemapArrayTextures지원 안 함Device.SystemInfo.supportsCubemapArrayTextures를 참조하십시오.
copyTextureSupport지원 안 함Device.SystemInfo.copyTextureSupport를 참조하십시오.
supportsComputeShaders지원 안 함Device.SystemInfo.supportsComputeShaders를 참조하십시오.
supportsGeometryShaders지원 안 함Device.SystemInfo.supportsGeometryShaders를 참조하십시오.
supportsTessellationShaders지원 안 함Device.SystemInfo.supportsTessellationShaders를 참조하십시오.
supportsInstancing지원 안 함Device.SystemInfo.supportsInstancing을 참조하십시오.
supportsHardwareQuadTopology지원 안 함Device.SystemInfo.supportsHardwareQuadTopology를 참조하십시오.
supports32bitsIndexBuffer지원 안 함Device.SystemInfo.supports32bitsIndexBuffer를 참조하십시오.
supportsSparseTextures지원 안 함Device.SystemInfo.supportsSparseTextures를 참조하십시오.
supportedRenderTargetCount지원 안 함Device.SystemInfo.supportedRenderTargetCount를 참조하십시오.
supportsSeparatedRenderTargetsBlend지원 안 함Device.SystemInfo.supportsSeparatedRenderTargetsBlend를 참조하십시오.
supportedRandomWriteTargetCount지원 안 함Device.SystemInfo.supportedRandomWriteTargetCount를 참조하십시오.
supportsMultisampledTextures지원 안 함Device.SystemInfo.supportsMultisampledTextures를 참조하십시오.
supportsMultisampleAutoResolve지원 안 함Device.SystemInfo.supportsMultisampleAutoResolve를 참조하십시오.
supportsTextureWrapMirrorOnce지원 안 함Device.SystemInfo.supportsTextureWrapMirrorOnce를 참조하십시오.
usesReversedZBuffer지원 안 함See Device.SystemInfo.usesReversedZBuffer.
npotSupport지원 안 함Device.SystemInfo.npotSupport를 참조하십시오.
maxTextureSize지원 안 함Device.SystemInfo.maxTextureSize를 참조하십시오.
maxCubemapSize지원 안 함Device.SystemInfo.maxCubemapSize를 참조하십시오.
maxComputeBufferInputsVertex지원 안 함See Device.SystemInfo.maxComputeBufferInputsVertex.
maxComputeBufferInputsFragment지원 안 함Device.SystemInfo.maxComputeBufferInputsFragment를 참조하십시오.
maxComputeBufferInputsGeometry지원 안 함Device.SystemInfo.maxComputeBufferInputsGeometry를 참조하십시오.
maxComputeBufferInputsDomain지원 안 함Device.SystemInfo.maxComputeBufferInputsDomain을 참조하십시오.
maxComputeBufferInputsHull지원 안 함Device.SystemInfo.maxComputeBufferInputsHull을 참조하십시오.
maxComputeBufferInputsCompute지원 안 함Device.SystemInfo.maxComputeBufferInputsCompute를 참조하십시오.
maxComputeWorkGroupSize지원 안 함Device.SystemInfo.maxComputeWorkGroupSize를 참조하십시오.
maxComputeWorkGroupSizeX지원 안 함See Device.SystemInfo.maxComputeWorkGroupSizeX.
maxComputeWorkGroupSizeY지원 안 함See Device.SystemInfo.maxComputeWorkGroupSizeY.
maxComputeWorkGroupSizeZ지원 안 함See Device.SystemInfo.maxComputeWorkGroupSizeZ.
supportsAsyncCompute지원 안 함Device.SystemInfo.supportsAsyncCompute를 참조하십시오.
supportsGraphicsFence지원 안 함Device.SystemInfo.supportsGraphicsFence를 참조하십시오.
supportsAsyncGPUReadback지원 안 함Device.SystemInfo.supportsAsyncGPUReadback을 참조하십시오.
supportsParallelPSOCreation지원 안 함Device.SystemInfo.supportsParallelPSOCreation을 참조하십시오.
supportsRayTracing지원 안 함Device.SystemInfo.supportsRayTracing을 참조하십시오.
supportsRayTracingShaders지원 안 함Device.SystemInfo.supportsRayTracingShaders를 참조하십시오.
supportsInlineRayTracing지원 안 함Device.SystemInfo.supportsInlineRayTracing을 참조하십시오.
supportsSetConstantBuffer지원 안 함Device.SystemInfo.supportsSetConstantBuffer를 참조하십시오.
hasMipMaxLevel지원 안 함See Device.SystemInfo.hasMipMaxLevel.
supportsMipStreaming지원 안 함Device.SystemInfo.supportsMipStreaming을 참조하십시오.
usesLoadStoreActions지원 안 함Device.SystemInfo.usesLoadStoreActions를 참조하십시오.

최소한의 디바이스 정의

다음 기기 정의에는 모든 필수 프로퍼티가 포함되며, 선택적 프로퍼티는 포함되지 않습니다. 이는 사용할 수 있는 최소 디바이스 정의입니다.
참고
이 기기 정의는 방향 데이터를 제공하지 않으므로 시뮬레이터는 기기가 모든 방향을 지원하고 안전 영역이 화면 전체를 커버한다고 가정합니다.
{ "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 모델의 디바이스 오버레이를 보여줍니다.
참고
기기 오버레이를 사용할 때 보이는 것을 모방하기 위해 다음 예제는 탭할 수 있는 화면 영역에 Unity 기본 스카이박스 표시합니다. 실제 기기 오버레이에서 이러한 픽셀은 투명해야 합니다.

Apple iPhone 8 오버레이

Apple iPhone XS 오버레이

기기 오버레이 사용

기기 오버레이 텍스처를 생성한 후 기기 정의와 함께 사용하려면 먼저 기기 오버레이 텍스처 파일을 프로젝트로 임포트해야 합니다.
참고
기기 시뮬레이터가 기기 오버레이 텍스처를 로드할 때 해당 텍스처에 대해 Read/Write를 활성화하려고 시도합니다. 이 작업이 불가능하면 기기 시뮬레이터가 텍스처를 표시하지만 텍스처를 사용하여 입력을 마스킹할 수 없습니다. 즉, 기기 오버레이가 마스킹해야 하는 화면의 노치 및 기타 영역을 클릭 수 기기 시뮬레이터가 입력을 감지합니다. 이를 방지하기 위해 기기 오버레이 텍스처를 임포트할 때 Texture Import Settings 창에서 Read/Write를 활성화합니다.
기기 오버레이 텍스처가 프로젝트에 있으면 기기 정의 파일을 열고 기기가 지원하는 화면을 정의하는 오브젝트에 프레젠테이션 프로퍼티를 추가합니다. 여기서 이미지 파일의 경로(
overlayPath
)와 테두리 크기(
borderSize
)를 설정합니다. 이를 수행하는 방법에 대한 예시는 다음 기기 정의 파일을 참조하십시오.
{ "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" }}
참고
기기 오버레이 텍스처 파일의 경로는 기기 정의 파일을 기준으로 하거나 Unity 프로젝트 Assets 또는 Packages 디렉토리가 포함된 디렉토리를 기준으로 할 수 있습니다. 예를 들어 기기 정의 파일이 Assets/Devices 디렉토리에 있고 기기 오버레이 파일이 Assets/Devices/Overlays 디렉토리에 있는 경우 다음 파일 경로는 모두 유효합니다.
  • 기기 정의 파일과 관련된 내용: Overlays/MinimalDeviceOverlay.png
  • Assets 디렉토리를 포함하는 디렉토리에 상대: Assets/Devices/Overlays/MinimalDeviceOverlay.png