Author Topic: get GameObject that called notified method (IUButton)  (Read 2813 times)

pdrocb

  • Guest
get GameObject that called notified method (IUButton)
« on: October 16, 2013, 04:43:13 PM »
Hello,

How do I get the name of the Button that called my method in the another script?

In the OnClick option under IUButton script I can set the method of another gameobject that I want to call.
In this called method I want to get the button that made the call.

I'm using the lastest version of NGUI 3.0.2

Regards,

macy

  • TNP Alpha
  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 8
    • View Profile
Re: get GameObject that called notified method (IUButton)
« Reply #1 on: October 16, 2013, 08:33:13 PM »

Spek

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: get GameObject that called notified method (IUButton)
« Reply #2 on: October 29, 2013, 05:31:08 AM »
same question
also, in the OnClick "Notify" option under IUButton script I can only choose methods without arguments.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: get GameObject that called notified method (IUButton)
« Reply #3 on: October 29, 2013, 04:51:50 PM »
Debug.Log(UIButton.current.name);