TileManager

A simple tile editor script.

Here's how you use it, first import those two scripts, the first one can be anywhere, you probably want to place it with your game scripts.

The second script you need to place in the Editor folder, it extends the Tiles class.

Here's how you use it:

Attach a "Tiles" script to any object, then the grid will be drawn. In the inspector you can find those types of fields:

-Tile width, height -> those impact the size of your grid (in units). -Grid Offset X,Y -> this offsets the grid position (in units). -Object Offset X,Y -> this offsets the tiles from the center of the grid square -Grid Color           -> The color of the grid -Z position           -> the Z position at which the tiles will be placed -Draw Key             -> painta the selected tile on the grid -Delete Key           -> deletes a tile from the grid -Disable Key          -> disables the tile manager -Align Key            -> aligns anything selected to the grid -Set Parent Key       -> sets the parent of the created -Increase Depth Key   -> increases the Z position by one -Decrease Depth Key   -> decreases the Z position by one -Is Enabled? -> enables or disables the manager -Tiles' Parent        -> a reference to a parent of the created tiles, if reference is not set the tiles will be created in the top of Hierarchy

Remember that you have to use keys when the scene view is active. Also, if you reimport the assets you need to select the tile manager for the script to work.

There are also two buttons, the first one is for aligning the grid with exact parent position, which helps to align the grid when the parent of the tiles is moved together with them. The second one does the same thing but it also offsets the grid by 0.5, you may want to use that to solve the floating point errors with rendering 2D sprites if your parent isn't placed properly.