Author Topic: uvRect on UITexture  (Read 3214 times)

mtompson

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 17
    • View Profile
uvRect on UITexture
« 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...

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: uvRect on UITexture
« Reply #1 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.