标题: A tileset selector(三) [打印本页] 作者: 会飞的鱼 时间: 2011-11-18 15:15 标题: A tileset selector(三)
Note that it will be stretched over your selection.
Step 4
Drag your main tileset from your hierarchy to the "Current Tileset" variable exposed in the Tile Manager component of your GameObject from Step 1. Set the "Tile Size" variable exposed directly below it. This is the square root size in pixels of each individual tile. For example, a value of "16" indicates that each tile in your tileset is 16 pixels by 16 pixels (16x16).
Step 5
Set the "Unique ID" property. This should be a way for you to identify the assets that will be created, and it must be unique (or else the editor will overwrite existing assets).
Step 6
Click "Open Tile Selector". An EditorWindow will pop up with your tileset. Use the Zoom buttons to get closer or further from your tileset. Click and drag to select the area you want on your sprite. Click "Set Sprite" to apply the cropped image. You're done!
Step N
To skip all the setup, just duplicate the sprite you made above, or work from a prefab, and the process becomes much faster.
Extras
If you somehow lost your assets, just press "Reselect last tile configuration", and the script will pick the last tile you chose and re-create and re-apply the texture and material.
If you want to get rid of the materials and assets you created with this tile, just press "RESET: Lose all assets and selection data?" to start this tile from scratch.