Version: 2020.1
언어: 한국어
타일맵 생성
타일 팔레트 생성

타일 생성

두 가지 방법으로 Unity에서 Tile 에셋을 생성할 수 있습니다. 첫 번째는 Assets 메뉴에서 타일 에셋을 생성하는 방법입니다. 두 번째는 여러 선택된 스프라이트로 타일 에셋을 자동 생성하는 방법입니다.

타일 에셋용 스프라이트 임포트 및 준비

텍스처를 Assets 폴더에 추가하여 타일맵을 위한 개별 타일이나 타일 세트 이미지를 Unity 프로젝트로 임포트합니다. 임포트한 이미지의 텍스처 임포터 설정을 확인하려면 인스펙터 창에서 해당 이미지를 선택합니다.

Sprite Importer settings.
Sprite Importer settings.

타일맵에서 사용할 스프라이트를 임포트할 때에는 다음의 권장 설정을 사용하십시오. 각 설정에 대한 자세한 내용은 텍스처 타입: 스프라이트(2D 및 UI)에 관한 문서를 참조하십시오.

  1. Texture Type - Set this to Sprite (2D and UI). Other Texture types are not supported for Tilemaps.
  2. Sprite Mode - Set this to Single if the Texture contains only a single Sprite. Set to Multiple if it contains multiple elements, for example a Tile sheet that contains multiple Tile Textures. Set Sprite Mode to Multiple when importing a Sprite sheet.
  3. Pixels Per Unit (PPU) - This value is the number of pixels that make up one Unity unit for the selected Sprite. This determines the size of the Tile Sprite when it is rendered on the Tilemap. It is recommended to set this value to the width(in pixels) of a single Tile Sprite so that a Tile is equal to one Unity unit in width. For both Hexagonal and Isometric Tiles, measure the width of the Sprites at their widest. The size of the Tile Sprites are also affected by the Cell Size property of the Grid parent of the Tilemap also affects the size of Tile Sprites as the Cell Size determines how many Unity units equal to a single Cell.

    In the example below, the imported Sprites are 64x64. The default Tilemap has a Cell Size of (XYZ: 1, 1, 0) Unity units. To make a Tile Sprite fit exactly on a single Cell of the Tilemap, set its PPU value to 64 to match its pixel width. The Sprite’s entire width then corresponds to one Unity unit, which is equal to the width (X value: 1) of a single Cell on the Tilemap. Left: Sprites set to 64 PPU. Middle: Same Sprites set to 128 PPU. Right: Sprites set to 32 PPU.
    By doubling the original PPU value of 64 to 128, the Sprite scales to 0.5(64px/128) Unity units in width. Halving the PPU value to 32 instead scales the Sprites to 2(64px/32) Unity units in width. The Sprites appear smaller or bigger respectively, however their Cell position on the Tilemap remains unchanged.
  4. Sprite Editor Outlines - After the Sprites are imported, refine the outlines of the Sprites by opening each of them in the Sprite Editor and editing their outlines. If the Texture is imported with Sprite Mode set to Multiple and contains multiple Sprites, then edit the outline of each of the Sprites in the editor.

Create a blank Tile Asset from the Asset menu

Create a Tile directly from the Assets menu by going to Assets > Create > Tile. You will be prompted to name and save the new blank Tile Asset to your chosen location. Refer to the documentation on Tile Assets for more information about the Asset properties.

Creating a new Tile Asset.
Creating a new Tile Asset.

Generate Tile Assets automatically in the Tile Palette

Tiles can be automatically generated by bringing the individual Sprites or Sprite sheets of the Tiles directly into the Tile Palette window (if the window is not open, go to Window > 2D > Tile Palette).

First prepare and import the Tile Sprites, then open the ‘New Palette’ drop-down menu in the Tile Palette window. Select an existing Tile Palette from the list, or select ‘Create New Palette’ to open the Create New Palette dialog box.

The New Palette drop-down menu.
The New Palette drop-down menu.

After selecting the properties of the Tile Palette (refer to the Tile Palettes documentation for more information about the different options), select Create to open the new Palette in the window.

Select Create to create a new Tile Palette.
Select ‘Create’ to create a new Tile Palette.

After creating or loading a Palette, drag and drop Textures or Sprites from the Assets folder directly onto the Tile Palette window. You will be prompted for the save location for the new Tile Assets. Select the save location, and the new Tile Assets are generated in the selected folder. The generated Tiles are also automatically placed onto the Palette.

Tile Asset credit to Kenney
Tile Asset credit to Kenney

  • 2020.1에서 페이지 콘텐츠 및 스크린샷 업데이트됨 NewIn20201
  • 2017.2에서 타일맵 추가됨NewIn20172
타일맵 생성
타일 팔레트 생성