Quantcast
Channel: Questions in topic: "chunks"
Viewing all articles
Browse latest Browse all 165

Unity 5 - Convert sprites into singular sprite.

$
0
0
Hi all, First of all I would like to mention that this code will be run in an editor script so that when a button is pressed in the editor a group of sprites will be converted into one larger collection of sprites. **The Problem** I have a 2D game where chunks of tiles are loaded from a data file when the player moves, however instantiating a chunk of 16x16 tiles hangs the game for about 70ms. To get around this issue I thought it would be better if in the scene editor the button currently used to write all tiles positions to a file could be used to combine the 16x16 area of tiles into one bigger sprite, then save this to a prefab folder with the chunk coordinates. Then when I come to instantiating the chunks I only have to instantiate one object instead of 256, this should reduce the noticable lag when the player moves around the world. **The Question** How can I combine a 16 x 16 area of tiles (Often different sprites but all the same size) into one larger sprite then save this to the resources folder for later use? Thanks for taking the time to read my question.

Viewing all articles
Browse latest Browse all 165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>