Hey guys,
I’m totally new to Unity, but I am into coding developing for years.
For my project I am trying to accomplish something with which I hope you can help me out to get a starting point.
I’m trying to make several meshes, and texture them with a repeating texture. Thing is, these meshes are supposed to be modified during runtime (or to be more precise, deleted and rebuild). Think of FruitNinja, only in 2D - the meshes shall be cut at some point, and both new elements shall have the textures cut accordingly.
To make it a bit more clear, I have drawn a little sketch (just a simple example):
Currently I tried to make my starting meshes in Blender, imported them, and attached my texture. Thing is, if I don’t export my UVs, my mesh will only show a single color from my texture, but not the texture at all.
I also took a look at an approach with only Sprites and no Meshes at all, but as far as I could figure out, there is no way to manipulate Sprites at runtime, am I correct?
I really hope I could make my problem clear enough, since I am not a native speaker.
Thanks a lot in advance, any help is greatly appreciated.
Best regards,

Well yes, you have to have UVs in order to have a UV-mapped texture.
I’m not sure that starting with a Blender mesh is going to be very helpful; you’re going to be neck-deep in mesh math anyway, so you may as well create your meshes from scratch.
Or, you could look in the Asset Store — there are some scripts there to automatically explode objects into fragments, that may already do what you want.
Yeah, I figured I should put Blender out of the equasion, since it’s 2D only anyways.
I found a really nice asset in the store for what I’m trying to accomplish (http://spriteslicer.blogspot.co.uk/), I’m just the kind of guy who wants to make as much as possible from scratch, to understand what’s really going on.
Guess I’ll buy the asset and have a look into it for research purposes at least.
If anyone still has any clues on how to approach this, please respond aswell, I’d love to get as much input as possible.
Thanks in advance
Well, in 2D, it’s fairly simple. You’ll have to create a new mesh with more triangles in it — exactly how you decide to break it up is up to you. But as for the texture, you just do a linear interpolation in both u and v. In fact you could use the Mathf.Lerp function to do this for you, passing in (for example) the u coordinate of the leftmost point, the u coordinate of the rightmost point, and then the fraction that indicates what portion of the way your new point is between the left and the right. This will give you the u coordinate for the new point. Then, do the same for v, and off you go!