Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: mtompson on September 12, 2013, 04:06:49 PM

Title: uvRect on UITexture
Post by: mtompson on September 12, 2013, 04:06:49 PM
Hi
I have a texture (on a UITexture object) I need to move using it's UVs all the time. I am using:

  1. .uvRect = new Rect( (_magnetic / 360.0f) , 0f, 1f, 1f);

Its in the onUpdate. It works fine, but I'm just thinking about performance, do I need to build a new Rect all the time? All I need to change is the UV x axis.

I tried 'uvRect.x =' but that throws up an error:

error CS1612: Cannot modify a value type return value of `UITexture.uvRect'. Consider storing the value in a temporary variable

many thanks for any ideas...
Title: Re: uvRect on UITexture
Post by: ArenMook on September 13, 2013, 09:31:12 AM
Optimizing something like this is the equivalent of worrying about a single raindrop falling into a vast ocean.