Author Topic: error going from V3.03 to 3.6 (latest) how to fix?  (Read 7942 times)

arkon3

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 71
    • View Profile
error going from V3.03 to 3.6 (latest) how to fix?
« 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?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: error going from V3.03 to 3.6 (latest) how to fix?
« Reply #1 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.