Author Topic: How do I pass variables/values from NGUI Drag Drop function?  (Read 1808 times)

BenChew

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
How do I pass variables/values from NGUI Drag Drop function?
« on: November 28, 2013, 12:13:48 AM »
Hey Aren.

As the topic states, I'm trying to pass on variables from a script in a Drag Drop item to its prefab, like HP and levels.

I'm not sure if this kind of thing is out of the way of your Support or not, so do tell if I'm in a wrong place. Thanks ^^

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How do I pass variables/values from NGUI Drag Drop function?
« Reply #1 on: November 28, 2013, 01:13:46 AM »
Create a data holder script attached to your dragged item. Set the values you need on it. When the item is dropped, GetComponent on that script, and there are your values.

BenChew

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: How do I pass variables/values from NGUI Drag Drop function?
« Reply #2 on: November 28, 2013, 01:44:59 AM »
Thank you very much!