2D Tilemap Starter Kit

Author
Dean Lunz (aka Created by: X)

createdbyx@createdbyx.com

http://www.createdbyx.com/

Description
The code is intended as learning material as well as providing code for use as a starting point for how to build a minimalistic 2D tile map & editor within unity.

Provides two simple C# scripts that are fully commented. The TileMap.cs script is intended to be attached to a game object. When the Game object is selected the inspector will contain properties that controls the number of Rows & Columns as well as the tile width and height.

The TileMapEditor.cs script is an editor script that contains all the drawing logic.

How to use

 * Download the 2DTileMapping Starter kit.zip file and extract the *.unitypackage file within it.
 * Import the *.unitypackage into a new unity project
 * Create a new game object in the unity editor
 * Attach the TileMap component to the game object "Components->Scripts->CBX.TileMapping.Unity->Tile Map"
 * You should see a grid displayed in the scene view. As you move your mouse over it a red box will be shown indicating where drawing will occur.
 * Use left mouse button to draw. Right mouse button erases.

Unity Package Download [[Media:2DTileMapping Starter kit.zip]]



Source Code
Code for TileMap.cs ...

Code for TileMapEditor.cs ...