Author Topic: EventDelegate Inspector Bug?  (Read 3141 times)

wishful_st

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
EventDelegate Inspector Bug?
« on: July 15, 2014, 06:10:57 PM »
Hi there,

I'm using NGUI 3.6.8 and noticed that in the console spits out errors when I try to assign targets for an EventDelegate, specifically, when the gameobject target's function's name have different signatures (e.g. LoginWithFacebook() vs LoginWithFacebook(bool b)).  I've tried changing the function names such that they are unique and only have one signature and that clears up the error.

The console spits out the error:

  1. Could not find method 'LoginWithFacebook' on SignInController
  2. UnityEngine.Debug:LogError(Object, Object)
  3. EventDelegate:Cache() (at Assets/NGUI/Scripts/Internal/EventDelegate.cs:388)
  4. EventDelegate:get_parameters() (at Assets/NGUI/Scripts/Internal/EventDelegate.cs:176)
  5. EventDelegateEditor:Field(Object, EventDelegate, Boolean, Boolean) (at Assets/NGUI/Scripts/Editor/EventDelegateEditor.cs:143)
  6. EventDelegateEditor:Field(Object, List`1, String, String, Boolean) (at Assets/NGUI/Scripts/Editor/EventDelegateEditor.cs:273)
  7. NGUIEditorTools:DrawEvents(String, Object, List`1, String, String, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:1411)
  8. NGUIEditorTools:DrawEvents(String, Object, List`1, Boolean) (at Assets/NGUI/Scripts/Editor/NGUIEditorTools.cs:1394)
  9. UIButtonEditor:DrawProperties() (at Assets/NGUI/Scripts/Editor/UIButtonEditor.cs:91)
  10. UIButtonColorEditor:OnInspectorGUI() (at Assets/NGUI/Scripts/Editor/UIButtonColorEditor.cs:23)
  11. UnityEditor.DockArea:OnGUI()

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: EventDelegate Inspector Bug?
« Reply #1 on: July 15, 2014, 11:42:04 PM »
Right, if you have overloaded functions it won't know which one it should be using. You should be using unique names with the EventDelegate.