Author Topic: EventDelegate callback, sending params and reference of Object firing event.  (Read 1724 times)

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
I have the following code:

EventDelegate.Add(popup.onChange,onPopupChanged,false);

   public void onPopupChanged()
   {
      Debug.Log("onChanged callled");
   }

1. In the onPopupChanged(), I would like to get the reference to the popup Go.
2. Is there a way to send some parameters to the call back function when the onChange happens ?

Perhaps this is not a proper use of EventDelegate.  So my question is how can I achieve the above 2 items when the popupList changes.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
In 3.5.6: https://www.youtube.com/watch?v=K3lvXIvJFKc&list=UUQGZdUwzE8gmvgjomZSNFJg

Currently UIPopupList.current tells you who triggered the event, letting you do whatever you wish from there. It's always ".current" with NGUI. UIButton.current, UICamera.current, UIToggle.current, etc.