I'm creating materials in script and assigning them to objects in my scene and have not experience any problems on OSX/Windows, but when I build and deploy to iOS I am getting a crash in my coroutine that loads/creates scene resources.
The crash happens when creating materials, and it doesn't crash on the first material (which uses a mobile/bumped specular shader.)
The crash happens on the second material in the Material constructor using Shader.Find( "Specular" )
I'm not aware of any restriction on using non-mobile shaders (not withstanding performance concerns of course), so I am stumped as to why this is crashing.
I've not spend anytime debugging with XCode before so I am having a hard time finding the culprit error on "Material.cpp line 268" when my XCode project doesn't have *.cpp files and doesn't have any files named material with any extension...
I'm virtually certain this is some dumb "welcome to Unity iOS you noob" issue.
Anyone...?
Here's the offending portion of code right up until what XCode is telling me is the crash source:
//Set materials for the frame
l_oFrameRenderer.material = new Material( Shader.Find( "Mobile/Bumped Specular" ) );
l_oFrameRenderer.material.name = "Titlebar Frame Material";
l_oFrameRenderer.material.SetTexture( "_MainTex", l_oLeatherTexture );
l_oFrameRenderer.material.SetTextureScale( "_MainTex", new Vector2( 7.0f, 7.0f ) );
l_oFrameRenderer.material.SetTexture( "_BumpMap", l_oLeatherNormalMap );
l_oFrameRenderer.material.SetTextureScale( "_BumpMap", new Vector2( 7.0f, 7.0f ) );
//Set materials for the inset - POP - Exception when the following line executes...
l_oInsetRenderer.material = new Material( Shader.Find( "Specular" ) );
↧