Author Topic: UIButton sprite keeps resetting  (Read 2458 times)

m0rgul

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
UIButton sprite keeps resetting
« on: August 07, 2014, 05:22:26 AM »
I have some widgets and in one I have a gender select, in the next one some options based on said gender. Once I select a gender, the buttons in the second widget should update accordingly...which actually happens...until I mouse over them and mouse out. When I mouse out, the sprite on the button reverts back to the original one... why?

Code goes something like this...

UISprite button= GameObject.Find ("Button1").GetComponent<UISprite> ();
button.spriteName = "somethingElse";

m0rgul

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: UIButton sprite keeps resetting
« Reply #1 on: August 07, 2014, 05:42:34 AM »
Fixed... I used slightly different code here...

UIButton btt = ...
btt.normalSprite = "..."

aparently this works...