Author Topic: Setting defaultColor on new UIButton  (Read 2455 times)

nwellnhof

  • Guest
Setting defaultColor on new UIButton
« on: August 23, 2013, 08:29:31 AM »
Setting the defaultColor on a newly created UIButton which hasn't been started yet has no effect. The following patch made it work for me:

  1. --- a/Assets/NGUI/Scripts/Interaction/UIButtonColor.cs
  2. +++ b/Assets/NGUI/Scripts/Interaction/UIButtonColor.cs
  3. @@ -48,10 +48,13 @@ public class UIButtonColor : MonoBehaviour
  4.         {
  5.                 get
  6.                 {
  7. -                       if (!mStarted) Init();
  8. +                       if (!mStarted) Start();
  9.                         return mColor;
  10.                 }
  11. -               set { mColor = value; }
  12. +               set {
  13. +                       if (!mStarted) Start();
  14. +                       mColor = value;
  15. +               }
  16.         }
  17.  
  18.         void Start ()