From the course: Unity 5: 2D Movement in an RPG Game

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Extend the map tile renderer

Extend the map tile renderer - Unity Tutorial

From the course: Unity 5: 2D Movement in an RPG Game

Start my 1-month free trial

Extend the map tile renderer

- [Voiceover] So now that we've added the ability to track whether a tile has been visited or not and we can calculate the fog of war autotile ID based on that value, it's time for us to rewrite the way that the map renderer works. To get started, we're gonna wanna go into the map tester and add a few new properties. Inside of our RandomAppTester class, let's scroll up to where we set the islandTexture. We can copy this and paste it below and simply rename it fog of war texture. Let's scroll down to below, where we create our tmpX and tmpY, and create a new private field. Here, we're gonna start by making a private Sprite array, and we'll call this islandTileSprites. Then, let's copy this and rename islandTileSprites to fog of war tile sprites. The plan is to take each of our textures for the island tiles and the fog of war tiles, convert them into an array of sprites, and we can use them in the new renderer. Inside of our Start method, above where we set the new map value, let's go…

Contents