First time building and running my Unity3D app on my iPhone and it appears that all the textures are missing. Everything is just a solid block of whatever color I made it. When running in Unity I see everything correctly. See images…
I am using custom shaders, and all the objects are custom procedural meshes. Many many quads that I build in script. In my paper backplate inspector you can see that on the material I don’t have the texture linked. Instead I have it linked on the main script and then I assign that texture to the material in Awake.
void Awake ()
{
meshFilterComponent = GetComponent<MeshFilter>();
Material material = GetComponent<MeshRenderer>().material;
material.SetTexture(0, paperTexture);
material.color = new Vector4(1f, 1f, 1f, 1f);
}
When I hit play the script runs and the texture in the inspector changes from None to the paper texture. The mesh gets built in the script. Everything renders fine. But when I run it on the iPhone I suspect that it’s not finding that paperTexture in the assets. It renders the quad all white. If I pre-link the Texture to the paper texture and then build it on the phone the texture renders correctly on the phone. But that doesn’t work for me because in other cases (not this paper background) I need to be able to pick the appropriate texture programmatically. For example if I were to have skin-able themes or something.
Any clue why the texture wouldn’t already be part of the project in iOS when it is linked to the Paper Texture property of the PaperBackplate script? Or why that would only be a problem on iOS and not when run in the unity interface.
Is there a way to make sure that a texture is going to be part of a project? Also where in the iOS project in Xcode do you find assets like textures? I’m not seeing them in the Xcode project anywhere even when it does render with the texture.
UPDATE
I changed my texture folder to “Resources” but that didn’t fix it.