HexMapLibrary
|
The first step of almost every project will be to create the map or board of the game. To do that we first need to import our library into unity (Menubar -> Assets -> Import Package -> Custom Package -> Select the HexMapLibrary.unitypackage file). For now we recommend importing the example folder as they include a hexagon mesh and some other sample prefabs which we use in the following tutorials.
The next step is creating a new script file and reference the needed namespaces of our library:
Now we create some variables which we can set in the inspector: the map size and the gameObject we use to represent each tile. [TODO :Explanation of the gameObject and it's material/shader]
Then we can create our map. For this simple example we want each tile to represent an integer and we want the map to be rectangular and do not want it be wrapping around.
Now let's set change the settings of our camera so we can see the whole map and center it:
You should end up with something looking like this:
This concludes this example, now let's continue with the next [ADD LINK]