Author Topic: Is there a way to set data to ngui Item?  (Read 1194 times)

leegod

  • Jr. Member
  • **
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 90
    • View Profile
Is there a way to set data to ngui Item?
« on: September 18, 2014, 08:03:19 PM »
So like in this video,

http://youtu.be/WT1yPEUkdjo

I have units in my list (says inventory), and I can drag some unit and drop to battle field.

So there is 9 spaces on battlefield.

How can I set some data (int value in this case for representing battle field position) to dragged item?

So if I move to 1 posiiton (top left position from 9 positions), I want to assign int value of 1 to that gameobject (ngui dropped item prefab gameobject)

Thanks.


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,154
  • Toronto, Canada
    • View Profile
Re: Is there a way to set data to ngui Item?
« Reply #1 on: September 19, 2014, 08:19:00 PM »
You are the one who begins the drag operation inside your UIDragDropItem-derived class. You can keep whatever date you need inside it. Save whatever you need in OnDragDropStart().