Version: 2022.2
언어: 한국어
시뮬레이션된 클래스
기기 시뮬레이터 확장

기기 추가

기기 시뮬레이터에 새 기기를 추가하려면 기기 정의와 기기 오버레이를 생성합니다.

기기 정의는 Unity 프로젝트에서 확장자가 .device인 텍스트 파일입니다. 여기에는 기기의 프로퍼티를 설명하는 JSON 파일이 포함됩니다.

기기 오버레이는 기기 화면의 테두리와 노치, 펀치아웃, 직사각형 화면에 대한 기타 추가 사항을 함께 포함하는 이미지입니다. 기기 정의와 함께 선택적으로 사용하여 하드웨어 요소가 기기 화면을 방해하는 방식을 시각화하고 결과적으로 터치 입력이 실패하는 경우를 알아낼 수 있습니다.

기기 정의 생성

기기 정의는 기기를 나타내는 JSON 파일입니다. 필수 프로퍼티와 일부 선택적 프로퍼티가 모두 들어 있습니다. 기기 정의 파일에 오류가 있으면 파일을 선택할 때 인스펙터에 오류가 나타납니다.

스키마

프로퍼티 필수 설명
friendlyName 지원 기기의 UI에 표시할 이름입니다.
version 지원 기기 정의 파일의 버전을 나타냅니다. 현재 버전은 1입니다.
screens 지원 기기를 시뮬레이션할 화면을 각각 설명하는 오브젝트 리스트입니다. 여기에는 하나 이상의 화면이 포함되어야 합니다. 각 화면 오브젝트의 스키마에 대한 자세한 내용은 화면을 참조하십시오.
systemInfo 지원 기기의 기능을 설명하는 오브젝트입니다. 이 오브젝트의 값은 SystemInfo에 매핑됩니다. 시스템 정보 오브젝트의 스키마에 대한 자세한 내용은 SystemInfo를 참조하십시오.

화면

프로퍼티 필수 설명
width 지원 화면의 너비(픽셀 단위)입니다.
height 지원 화면의 높이(픽셀 단위)입니다.
navigationBarHeight 지원 안 함 전체 화면이 아닐 때 일부 기기 화면에 표시되는 Android 내비게이션 바의 높이(픽셀 단위)입니다.
dpi 지원 화면의 dpi입니다.
orientations 지원 안 함 화면이 시뮬레이션할 수 있는 방향을 각각 설명하는 오브젝트 리스트입니다. 이 프로퍼티에 값을 설정하지 않으면 화면이 모든 방향을 지원합니다. 각 방향 오브젝트의 스키마에 대한 자세한 내용은 방향을 참조하십시오.
presentation 지원 안 함 기기 오버레이를 설명하는 오브젝트입니다. 이 오브젝트의 스키마에 대한 자세한 내용은 프레젠테이션을 참조하십시오.

방향

프로퍼티 필수 설명
orientation 지원 화면 방향입니다. 이 프로퍼티의 값은 ScreenOrientation 열거형에 매핑되는 숫자입니다.
safeArea 지원 안 함 화면의 세이프 영역을 결정하는 Rect입니다. 이 프로퍼티의 값을 설정하지 않으면 시뮬레이터는 전체 화면을 세이프 영역으로 가정합니다.
cutouts 지원 안 함 콘텐츠를 표시할 수 없는 화면 영역을 지정하는 Rect 리스트입니다.

프레젠테이션

프로퍼티 필수 설명
overlayPath 지원 안 함 기기 정의 파일과 기기 오버레이로 사용할 이미지의 상대 경로입니다.
borderSize 지원 안 함 오버레이에서 화면이 시작되는 지점까지의 거리(픽셀 단위)입니다.

시스템 정보

이 오브젝트의 프로퍼티는 기기의 기능과 시스템 정보를 설명합니다. 시스템 정보를 설명하기 때문에 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 지원 안 함 Device.SystemInfo.graphicsMemorySize를 참조하십시오.
graphicsDeviceName 지원 안 함 Device.SystemInfo.graphicsDeviceName을 참조하십시오.
graphicsDeviceVendor 지원 안 함 Device.SystemInfo.graphicsDeviceVendor를 참조하십시오.
graphicsDeviceID 지원 안 함 Device.SystemInfo.graphicsDeviceID를 참조하십시오.
graphicsDeviceVendorID 지원 안 함 Device.SystemInfo.graphicsDeviceVendorID를 참조하십시오.
graphicsUVStartsAtTop 지원 안 함 Device.SystemInfo.graphicsUVStartsAtTop을 참조하십시오.
graphicsDeviceVersion 지원 안 함 Device.SystemInfo.graphicsDeviceVersion을 참조하십시오.
graphicsShaderLevel 지원 안 함 Device.SystemInfo.graphicsShaderLevel을 참조하십시오.
graphicsMultiThreaded 지원 안 함 Device.SystemInfo.graphicsMultiThreaded를 참조하십시오.
renderingThreadingMode 지원 안 함 Device.SystemInfo.renderingThreadingMode를 참조하십시오.
hasHiddenSurfaceRemovalOnGPU 지원 안 함 Device.SystemInfo.hasHiddenSurfaceRemovalOnGPU를 참조하십시오.
hasDynamicUniformArrayIndexingInFragmentShaders 지원 안 함 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 지원 안 함 Device.SystemInfo.usesReversedZBuffer를 참조하십시오.
npotSupport 지원 안 함 Device.SystemInfo.npotSupport를 참조하십시오.
maxTextureSize 지원 안 함 Device.SystemInfo.maxTextureSize를 참조하십시오.
maxCubemapSize 지원 안 함 Device.SystemInfo.maxCubemapSize를 참조하십시오.
maxComputeBufferInputsVertex 지원 안 함 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 지원 안 함 Device.SystemInfo.maxComputeWorkGroupSizeX를 참조하십시오.
maxComputeWorkGroupSizeY 지원 안 함 Device.SystemInfo.maxComputeWorkGroupSizeY를 참조하십시오.
maxComputeWorkGroupSizeZ 지원 안 함 Device.SystemInfo.maxComputeWorkGroupSizeZ를 참조하십시오.
supportsAsyncCompute 지원 안 함 Device.SystemInfo.supportsAsyncCompute를 참조하십시오.
supportsGraphicsFence 지원 안 함 Device.SystemInfo.supportsGraphicsFence를 참조하십시오.
supportsAsyncGPUReadback 지원 안 함 Device.SystemInfo.supportsAsyncGPUReadback을 참조하십시오.
supportsRayTracing 지원 안 함 Device.SystemInfo.supportsRayTracing을 참조하십시오.
supportsSetConstantBuffer 지원 안 함 Device.SystemInfo.supportsSetConstantBuffer를 참조하십시오.
hasMipMaxLevel 지원 안 함 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,
                "supportsRayTracing": 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를 활성화합니다.

기기 오버레이 텍스처가 프로젝트에 있을 때 기기 정의 파일을 열고 해당 기기 화면을 정의하는 오브젝트에서 presentation 프로퍼티를 추가합니다. 여기에서 이미지 파일의 경로(overlayPath)와 테두리 크기(borderSize)를 설정합니다. 이를 수행하는 방법의 예는 다음 기기 정의 파일을 참조하십시오.

{
    "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
시뮬레이션된 클래스
기기 시뮬레이터 확장