0

Why I can't update UILabel's localScale if I assign a Vector3 directly?

It works well if write it in the following way:

label.transform.localScale += new Vector3(3.5f, 3.5f, 3.5f);

But it doesn't work with following ways:

label.transform.localScale = new Vector3(4.5f, 4.5f, 4.5f);

or

label.transform.localScale = Vector3.one * 4.5f;

Who can tell me why?

Bart
  • 19,692
  • 7
  • 68
  • 77
Jane_Meng
  • 749
  • 1
  • 9
  • 18
  • Is it UILabel from NGUI library you are talking about? – Michael Antipin Jul 27 '13 at 13:06
  • it is because label's original scale is one Vector3.one. So label.transform.localScale += new Vector3(3.5f, 3.5f, 3.5f) don't equal to label.transform.localScale = new Vector3(4.5f, 4.5f, 4.5f); – Jane_Meng Nov 20 '13 at 06:29

0 Answers0