Note: High level answers of the type "Read the documentation on the XXX function" appreciated here. I'm not sure where to begin researching a solution for this because everything I've done before has used PNGs built into the project.
Question: I've got an app I want to build in Unity. The app takes information from an RSS feed provided by a third party (under license, I'm not stealing, but they control the format of the data, not me.) I need to take that data an parse it and pull out text and images. I want to put the images into textures on objects in Unity.
I can use an RSS parser in objective-C. I have unity Pro, so I can use the "native code" functionality here. But I am curious how I take the JPGs (whose URLS are in the RSS feed) and convert them into textures I can apply to objects within the Unity Scene.
The JPEGS are of a uniform size. The meshes they will be applied to are all instantiated from the same prefab and are identical, except for the texture.
I can likely convert them to PNGs on the Objective-C side. So, maybe my question is: How do I create a couple hundred instances of a prefab, all of which have the same material, but each of which has a different texture?
Or can I programmatically create materials from JPEGs?
Maybe the process is, turn them into PNGs, move them from the Objective-C side and then create materials on the fly?
Appreciate any pointers if there is an easier way to do it, or if there's any gotchas I need to watch out for.
For instance, I understand that the Unity development environment does some processing to optimize textures during build, and I'll need to somehow make my images be in the right format for feeding to the game engine, at runtime.
asked Jan 09 '11 at 12:14 PM