Author Topic: Overloaded methods raise a Could not find method 'xxx' EventDelegate error  (Read 3658 times)

stapledon

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 23
    • View Profile
I'm in the process of migrating a project from NGUI 3.0.8f2 to 3.6.8, and so far I've only come across one issue.

Setting a widget's Notify to call a method which has overloads, i.e. foo(), foo(int a), will throw an error. In the quoted example below, there are two SetFXVolume methods, one taking an int.

Quote
Could not find method 'SetFXVolume' on SetCurrentValue
UnityEngine.Debug:LogError(Object, Object)
EventDelegate:Cache() (at Assets/NGUI/Scripts/Internal/EventDelegate.cs:388)
EventDelegate:get_isValid() (at Assets/NGUI/Scripts/Internal/EventDelegate.cs:193)
EventDelegate:IsValid(List`1) (at Assets/NGUI/Scripts/Internal/EventDelegate.cs:629)
UIProgressBar:set_value(Single) (at Assets/NGUI/Scripts/Interaction/UIProgressBar.cs:135)
SetCurrentValue:SetFXVolume(Int32) (at Assets//Code/SetCurrentValue.cs:848)
SetCurrentValue:Start() (at Assets//Code/SetCurrentValue.cs:128)


This hasn't been a problem with prior versions of NGUI and I can't see any mention of it in the release notes?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
EventDelegates work differently from system delegates, and them not handling overloaded functions is currently a known issue, but thanks.

numpy

  • Newbie
  • *
  • Thank You
  • -Given: 4
  • -Receive: 0
  • Posts: 7
    • View Profile
Has this been resolved yet? Currently running into the same issue.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
No, I haven't done anything about this one.