TileSet settings

Pocket

Operating environment

This tutorial is created in the following environment.

Unity 2019.4.31f1
Nostalgia 2.2.0

Depending on the version, please understand that there are parts different from the explanation.

Create tutorial project

First of all, please create a project for the tutorial.

Project Name NostalgiaTutorial01
Templetes 2D
Assets to import Nostalgia

For information on creating projects and importing Nostalgia, please refer to “Preparation for using Nostalgia”.

TileSet texture preparation

Create a folder to put the TileSet

First, create a folder to put the TileSet.

  1. Select the Assets folder from the Project window.
  2. Click the + button in the Project window.
  3. Select “Folder” from the menu.
  4. Set the name to “TileSets”.

 

Download tutorial material

This time, we have prepared the materials used for the TileSet in advance.

Please download and unzip from the button below.

“Tutorial01” をダウンロード

NostalgiaTutorial1.zip – 1279 回のダウンロード – 46.84 KB

(The material was borrowed from https://ci-en.net/creator/1430.)

Import TileSet textures

Next, import the texture for TileSet.

  1. Select the TileSets folder in the Project window.
  2. Drag and drop the downloaded tutorial material Dungeon.png to the TileSets folder

 

TileSet texture settings

Set the imported Dungeon texture.

  1. Select the Dungeon texture from the Project window.
  2. Set as follows in the Inspector window.
    Texture Type Sprite (2D and UI)
    Sprite Mode Multiple
    Pixels Per Unit 32
    Filter Mode Point (no filter)
  3. Click the Sprite Editor button.
  4. Click the Apply button when the “Unapplied import settings” dialog is displayed.

 

Sprite settings

  1. Click the Slice dropdown in the Sprite Editor window.
  2. Set as follows and click the Slice button.
    Type Grid By Cell Size
    Pixel Size X: 32, Y: 160
    Offset X: 0, Y: 0
    Padding X: 0, Y:0
    Keep Empty Rects オフ
    Pivot Center
    Method Delete Existing
  3. Drag the bottom edge of the Dungeon_6 and Dungeon_7 sprites to resize
    (Or set to Y: 224, H: 32)
  4. Click the Apply button in the Sprite Editor window.
  5. Close the Sprite Editor window.

 

TileSet Asset Preparation

Creating a TileSet asset

Create a TileSet asset that uses a Dungeon texture.

  1. Select the Dungeon texture from the Project window.
  2. Click the + button in the Project window.
  3. Select “Nostalgia > TileSet from selected Texture or Material” from the menu.

 

TileSet Asset Settings

Set tiles for TileSet assets.

Import from Sprite

Import each sprite of the Dungeon texture and set the Tile.

  1. Select the Dungeon tile set.
  2. Open Import from sprites in the Inspector window.
  3. Click the Check All button at the bottom.
  4. Uncheck Dungeon_4 and Dungeon_5 because they are animation tiles.
  5. Click the Import button.
  6. Close Import from sprites.

 

Tile settings

Set the details for each tile.

Dungeon_0 (floor)

Bordered floor of auto tile

  1. Select the very first tile (Dungeon_0) from Tiles.
  2. Change Type to “Auto Floor Wolf”.
  3. Change the Combination Group Name to “Floor”.

 

Dungeon_1 (wall)

Auto tile wall

  1. Select the second tile (Dungeon_1) from Tiles.
  2. Change Type to “Auto Floor Wolf”.
  3. Change Tile Collider to “Tile Box Collider”.

 

Dungeon_2 (ceiling)

Auto tile ceiling

  1. Select the third tile (Dungeon_2) from Tiles.
  2. Change Type to “Auto Floor Wolf”.
  3. Change the Combination Group Name to “Ceiling”.
  4. Change Tile Collider to “Tile Box Collider”.

 

Dungeon _3 (Water)

Animated water for auto tiles

  1. Select the 4th tile (Dungeon_3) from Tiles.
  2. Change Type to “Auto Floor Wolf”.
  3. Change Animation to 3.
  4. Change Tile Collider to “Tile Box Collider”.

 

Dungeon_6 (black ceiling)

Black single color tile that can be connected to Dungeon_2 (ceiling)

  1. Select the 5th tile (Dungeon_6) from Tiles.
  2. Change the Combination Group Name to “Ceiling”.
  3. Change Tile Collider to “Tile Box Collider”.

 

Dungeon_7 (borderless floor)

Borderless floor that can be connected to Dungeon_0 (floor)

  1. Select the 6th tile (Dungeon_7) from Tiles.
  2. Change the Combination Group Name to “Floor”.

 

Trial painting

After completing the settings, try painting.

  1. Click the + button in the Hierarchy window.
  2. Select “Nostalgia Map” from the menu.
  3. Changed Tile Set of Map component to “Dungeon Tile Set”.
  4. Click the Open Editor button.
  5. Select the pencil tool.
  6. Select the tile to place from Tiles.
  7. Left button drag the Map area of the Scene window.
  8. Check if there is a problem with the settings of each tile.
  9. Click the Play button and check the animation of Dungeon_3 (Water).