Author Topic: Argumentexception: couldn't bind to method play  (Read 2129 times)

dleight

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Argumentexception: couldn't bind to method play
« on: February 22, 2014, 11:26:51 PM »
Hi,

Using NGUI 3.4.9 and Unity Pro 4.3.1f1. I've been working without a problem the last couple of days, but now am getting a Argumentexception: couldn't bind to method 'Play' error.

The error comes up when I click a button which invokes a tween alpha on a sprite which has this hierarchy:

Sprite
-button
-scrollview
--grid
---empty widget1 (collider, UIDrag Scroll View, UICenter on Click)
----label
----label
---empty widget2 (collider, UIDrag Scroll View, UICenter on Click)
----label
----label

The last thing I did before I got this error, was to change the font on a label under empty widget1.

Here is the console output:

  1. System.Delegate.GetCandidateMethod (System.Type type, System.Type target, System.String method, BindingFlags bflags, Boolean ignoreCase, Boolean throwOnBindFailure) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System/Delegate.cs:351)
  2. System.Delegate.CreateDelegate (System.Type type, System.Object target, System.String method, Boolean ignoreCase, Boolean throwOnBindFailure) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System/Delegate.cs:397)
  3. System.Delegate.CreateDelegate (System.Type type, System.Object target, System.String method, Boolean ignoreCase) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System/Delegate.cs:406)
  4. System.Delegate.CreateDelegate (System.Type type, System.Object target, System.String method) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System/Delegate.cs:300)
  5. EventDelegate.Get () (at Assets/NGUI/Scripts/Internal/EventDelegate.cs:154)
  6. EventDelegate.Execute () (at Assets/NGUI/Scripts/Internal/EventDelegate.cs:219)
  7. EventDelegate.Execute (System.Collections.Generic.List`1 list) (at Assets/NGUI/Scripts/Internal/EventDelegate.cs:293)
  8. UIButton.OnClick () (at Assets/NGUI/Scripts/Interaction/UIButton.cs:120)
  9. UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
  10. UICamera:Notify(GameObject, String, Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:794)
  11. UICamera:ProcessTouch(Boolean, Boolean) (at Assets/NGUI/Scripts/UI/UICamera.cs:1463)
  12. UICamera:ProcessMouse() (at Assets/NGUI/Scripts/UI/UICamera.cs:1092)
  13. UICamera:ProcessTouches() (at Assets/NGUI/Scripts/UI/UICamera.cs:1162)
  14. UICamera:Update() (at Assets/NGUI/Scripts/UI/UICamera.cs:939)

Any help would be greatly appreciated.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Argumentexception: couldn't bind to method play
« Reply #1 on: February 23, 2014, 12:23:08 PM »
UITweener.Play method has a parameter.

You need to bind to PlayForward or PlayReverse. Those don't have a parameter.

dleight

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
[Solved] Re: Argumentexception: couldn't bind to method play
« Reply #2 on: February 26, 2014, 01:31:47 PM »
Thank you - this led me to the fix.