- Home /
How to Render a Sliced Sprite to a Mesh?
I want to use a sliced sprite as a ground texture for my 2d game. I am generating the tile mesh, so how could I go about attaching a sprite to it? I am assuming I can use the automatic sprite slicer to chop up my tiles, but I do not know how to render a sprite to a mesh. I think I access the sprites with something like this:
Sprite[] textures = Resources.LoadAll("Textures");
But how can I specifically locate the sprite I want? I believe I would use some sort of index, but I am still unsure. Unity was also giving me errors about conflicting mesh renderers and sprite renderers. I was thinking that maybe this was because a Sprite might be some sort of Quad already.
Would it be more simple to just set the image file to 'Advanced' instead of 'Sprite', enable Read/Write, and then programmatically chop up the texture?
Thank you for your time!