- Home /
Device.Present taking 600ms on iPad after changing materials
I have a simple script attached to a bit of scenery which lets the user change its color. Typically it will change the color in about 6 materials. However doing so seems to trigger something very big and expensive as the framerate plummets and if I look at the profile I see Device.Present taking about 600ms instead of its normal 1.2ms. Any idea what might cause this?
public class StudioTinter : MonoBehaviour
{
public Color tint;
public void SetTint( Color color )
{
tint = color;
foreach( var material in GetComponent< MeshRenderer >().materials )
{
if( material.name.ToLower().Contains( "wall" ) )
material.SetColor( "_Color" , color );
}
}
}
Comment
Your answer