Version: 2022.1
언어: 한국어
배리언트 스프라이트 아틀라스
배포용 스프라이트 아틀라스 준비

스프라이트 아틀라스 워크플로

아래 단계에 따라 스프라이트 아틀라스를 만드십시오.

  1. 스프라이트 아틀라스 에셋을 만듭니다.
  2. 패킹용 오브젝트 리스트를 스프라이트 아틀라스에 선택합니다.
  3. 스프라이트 아틀라스에 대해 Include in build를 활성화하여 프로젝트에 포함합니다.
  4. (선택 사항) 배리언트 스프라이트 아틀라스를 만듭니다.
  5. (선택 사항) 배포용 스프라이트 아틀라스를 준비합니다.
    • 배포용으로 준비된 스프라이트는 스크립트로 늦은 바인딩을 통해 로드되어야 합니다.
  6. (선택 사항) 프로젝트에서 스프라이트 아틀라스 사용 및 크기를 최적화하여 성능을 개선합니다.

스프라이트 아틀라스 에셋 만들기

To create the Sprite Atlas Asset, go to Assets > Create > 2D > Sprite Atlas. Unity creates the Sprite Atlas in the Asset folder, with the file extension * .spriteatlas.

패킹용 오브젝트 리스트에 대한 항목 선택

The Objects for Packing list displays the currently selected items that are in the Sprite Atlas. You can place Texture2D and Sprite Assets in this list. Drag and drop a folder directly onto the list to automatically add all valid content within the folder to the list (only the folder appears on the list).

리스트에 대한 특정 항목을 선택하려면 다음 단계를 따르십시오.

  1. 스프라이트 아틀라스 에셋을 선택하고 인스펙터 창에서 Objects For Packing 리스트를 찾습니다. 여기에는 Unity가 스프라이트 아틀라스를 빌드할 때 패킹할 항목 리스트가 표시됩니다.

  2. To add items, select the plus (+) icon at the lower right of the list to create a new row. Drag a valid Asset onto an empty row to add it to the list, or select the circle icon to the right of the row to open the Select Object window. Select an Asset from the Object Picker window to add it to the list:

    To remove an item from the list, click the minus (-) icon at the lower right of the Objects For Packing list. To replace an item, drag another item to the row it occupies to replace it on the list.

  3. Select Pack Preview to preview the combined Atlas Texture in the Asset Preview window.

Include in Build 옵션

All Sprite Atlases have Include in Build enabled by default when created. This means that Unity includes the Sprite Atlases with the Project’s build and automatically loads them at the build’s run time. Enable or disable the ‘Include in Build’ property to control which Sprite Atlases are included in the Project build.

’Include in Build’를 해제하면 이 동작이 비활성화되고, 배포용 스프라이트 아틀라스를 준비할 때 완료됩니다.

Optimizing Sprite Atlas usage and size for improved performance

스프라이트가 씬에서 활성화되면 Unity는 해당 스프라이트가 속한 스프라이트 아틀라스와 거기에 포함된 모든 텍스처를 로드합니다. 이는 Unity가 매우 큰 텍스처가 포함된 스프라이트 아틀라스를 로드하지만 씬 내에서 해당 텍스처를 사용하는 요소가 없을 경우 과도한 성능 오버헤드가 발생합니다.

스프라이트 아틀라스 사용을 최적화하려면 씬에서 활성화된 모든 또는 대부분의 스프라이트가 동일한 아틀라스에 속해 있어야 합니다. 일반적인 용도에 따라 스프라이트 텍스처를 여러 개의 작은 아틀라스로 분할하는 것이 좋습니다.

성능 오버헤드를 줄이는 또 다른 방법은 스프라이트 아틀라스의 패킹된 텍스처 간에 빈 공간을 줄이는 것입니다. 이렇게 하면 스프라이트 아틀라스의 크기가 감소합니다. 이렇게 하려면 스프라이트 아틀라스를 선택하고 인스펙터 설정의 하단에 있는 팩 미리보기 창에서 패킹된 아틀라스 텍스처를 검사하십시오. 이용 가능한 미리보기가 없으면 Objects for Packing 리스트 아래의 Pack Preview 버튼을 선택하여 패킹된 텍스처를 생성해야 합니다.

Sprite Atlas with excess empty space.
Sprite Atlas with excess empty space.

과도한 빈 공간이 눈에 띄면 패킹된 텍스처의 크기를 수동으로 줄여서 빈 공간을 작게 만들고 아틀라스의 크기를 최적화할 수 있습니다. 이렇게 하려면 인스펙터 창 하단의 Platform-specific overrides 패널로 이동하십시오. 그런 다음 Max Texture Size 설정의 드롭다운 메뉴에서 낮은 값을 선택하고, Pack Preview를 선택하여 패킹된 텍스처를 다시 생성해야 합니다.

Set the Max Texture Size.
Set the Max Texture Size.

Max Texture Size 값이 스프라이트 아틀라스 텍스처의 현재 크기보다 작으면 Unity는 패킹된 텍스처 크기를 줄여서 설정된 Max Texture Size 값에 최대한 맞추고 불필요한 빈 공간을 자동으로 잘라냅니다. 선택한 스프라이트 텍스처가 스프라이트 아틀라스의 Max Texture Size 설정을 초과하는 경우 스프라이트 아틀라스는 Max Texture Size 설정을 무시하고 스프라이트 텍스처를 원래 크기로 포함하는 데 필요한 최소 크기를 유지합니다.

Textures in a Sprite Atlas remain in their original dimensions.
Textures in a Sprite Atlas remain in their original dimensions.

Note: When using Variant Sprite Atlases, selecting a very low scale value (less than 0.25) may result in visual artifacts, depending on the compression format used and original resolution of the Sprite. It is recommended to use high padding values and better compression formats when using Variant Atlases.

배리언트 스프라이트 아틀라스
배포용 스프라이트 아틀라스 준비
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961