Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: arkon3 on June 03, 2014, 02:54:22 AM

Title: error going from V3.03 to 3.6 (latest) how to fix?
Post by: arkon3 on June 03, 2014, 02:54:22 AM
I have some classes based on NGUI ones from V3.03 and I'm getting this error when upgrading the project to the latest NGUI:

Assets/Scripts/Gen/MyUIButton.cs(52,30): error CS0507: `MyUIButton.OnHover(bool)': cannot change access modifiers when overriding `protected' inherited member `UIButtonColor.OnHover(bool)'

This is the lines of code in question:

  1.         public override void OnHover (bool isOver) { if (isEnabled) base.OnHover(isOver); }
  2.         public override void OnPress(bool isPressed) { if(isEnabled) base.OnPress(isPressed); Send(); }
  3.  

How do I change them to work on the latest version of NGUI?
Title: Re: error going from V3.03 to 3.6 (latest) how to fix?
Post by: ArenMook on June 04, 2014, 12:30:12 AM
The button class has changed quite a bit a few months ago. You seem to have created your own class derived from button, so it's up to you to update it to use newer features.

I don't advise you to derive from NGUI's components in the future. Stick to writing stand-alone scripts.