Author Topic: Potential component order issues  (Read 2899 times)

getluky

  • Guest
Potential component order issues
« on: April 27, 2012, 01:06:14 PM »
@ArenMook, I just ran into an interesting issue with the use of SendMessage and component order on GameObjects. I had UIButtonPlayAnimation components attached to a UIButton that has a UIButtonKeys component attached "higher" on the gameObject. The purpose of the button was to switch panels and activate a default button attached to the selectOnClick property.

I've been trying to track down exactly what happens, but the solution is pretty easy - just always add UIButtonPlayAnimation before any UIButtonKeys component. As far as I can tell, if UIButtonKeys' OnClick fires before UIButtonPlayAnimation, then UIButtonPlayAnimation enables the panel that contains the receiver UIButton, the hover tween (such as a UIButtonColor) does not take effect. The button still gets selected, though.

I confirmed that this occurs in the Controller Input example if I remove then re-add the UIButtonPlayAnimation components on the Options button - after the panel switches, the Back button is selected but it doesn't appear as highlighted when the panel animates in.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Potential component order issues
« Reply #1 on: April 27, 2012, 06:07:00 PM »
Interesting... thanks for taking the time to investigate this.