Unity - TileMap Notes

This article describes some of the details in the use of Tilemap draw scenes that need attention.
About Tilemap the creation and use of this text does not explain, but it is recommended masterpiece: Unity to quickly create 2D game world using Tilemap - feng
paper project Address: Tilemap - SouthBegonia

Q1: tile matching

  • Scenario occurs: After you create Tilemap and a palette, we want the existing art assets (Jungle_Tileset.png) made of tiles, when the picture slices, drag Palette, draw maps will find tiles and does not match the unit cells in the scene scene , for example, FIG:

  • Problem Cause: The reason is that when we slice the picture, Pixels of Per Unit issue value.
  • Analysis: It is the meaning of each unit cell can accommodate the number of pixels of the picture . When the proportion of the order of FIG Pixels Per Unit a different value for each tile with a Unit of Scene scene. Take Pixels Per Unit = 43, its meaning is that each unit is only enough to hold 43 pixels, and our artwork (left) pixels, 1024x1024, doing each tile 128 pixels, but only to each of us a Unit43 pixels, from the far right picture we can see that about 9 unit before they can put down a tile.
  • How to solve: for art resources to be made for each tile is calculated Pixels Per Unit of. The most reasonable value of the present embodiment is 1024/8 = 128
  • So non tiles Sprite it? : Drag and drop directly into the Scene can zoom in and out.

Q2: Tiles of choice

  • Scenario occurs: After importing 2d-extras package, we can add the right kinds of Tiles (see below) in the Project. If we have to do a tile with the Animation , whether directly can be used directly AnimationTile type it? The answer is yes, but perfect practice is on-demand.

  • Cause of the problem: there is a difference RuleTile function of AnimatedTile
    • AnimatedTile:
      • The number of tiles: a tile of a monolithic operating
      • Animation speed: MinimumSpeed ​​~ MaximumSpeed
      • Start Time: Start Time
    • RuleTile (provided that the output type is set tile Animation):
      • The number of tiles: multi-chip and can function while achieving the rule of tiles
      • Animation speed: Speed
      • GameObject: function while achieving PrefabBrush
  • Summary: For tile with Animation, we should choose Tile type of demand . For example: different time-enabled stab, we should choose AnimatedTile thereby regulating the StartTime parameter; for example, long waterfall, we should use RuleTile, both to achieve Animation effects can easily draw more tiles; such as candles, we want to achieve combustion animation is inconsistent, it should be used in turn adjusts AnimatedTile Speed two parameters and the like. But in general, RuleTile integrates the basic functions of several types of extra tiles , more commonly used.

hot key

The direction of rotation of the tiles in the draw: [] key to
delete the tiles in a current draw: Hold down the shift + left-click

reference

Guess you like

Origin www.cnblogs.com/SouthBegonia/p/11592554.html