ExqueezeMe
New member
The surface system seems to be causing some exceptions when the materials don't have a _MainTex property (using custom shaders). On SurfaceManager line 683 there is the check:
But it seems to me that it should be the opposite (if the material doesn't have that property, return null), especially since the next line is
which will always cause an exception at this point. Furthermore, it looks to me like line 491 should additionally check if
I'm not sure if there are additional places this is needed but that seems to have fixed the issue for me.
C#:
if (material.HasProperty(s_MainTextureID)) {
return null;
}
C#:
var texture = material.mainTexture;
C#:
renderer.sharedMaterial.HasProperty(s_MainTextureID)