Author Topic: Error about EventDelegate!  (Read 1915 times)

xiaoniaojjj

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 140
    • View Profile
Error about EventDelegate!
« on: May 12, 2014, 11:37:13 AM »
Here is my code:
  TweenAlpha ta = gameObject.AddComponent<TweenAlpha>();
  ta.from = 1f;
  ta.to = 0f;
  ta.delay = delay;
  ta.duration = duration;
 ta.AddOnFinished(new EventDelegate(AlphaOut));   

It works fine in Last version, But alway throws the below Exception when i update to 3.5.9!
How to use it correct?



Failed to bind MUIFloatItemNeedSpaw.AlphaOut
Ambiguous matching in method resolution
UnityEngine.Debug:LogError(Object)
EventDelegate:Cache() (at Assets/NGUI/Scripts/Internal/EventDelegate.cs:359)
EventDelegate:Execute() (at Assets/NGUI/Scripts/Internal/EventDelegate.cs:420)
EventDelegate:Execute(List`1) (at Assets/NGUI/Scripts/Internal/EventDelegate.cs:569)
UITweener:Update() (at Assets/NGUI/Scripts/Tweening/UITweener.cs:224)
« Last Edit: May 12, 2014, 11:42:15 AM by xiaoniaojjj »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Error about EventDelegate!
« Reply #1 on: May 13, 2014, 08:08:07 AM »
You should be using:
  1. EventDelegate.Add(ta.onFinished, AlphaOut);
What does your AlphaOut function look like?