Author Topic: Inventory System Questions  (Read 1986 times)

Rajmahal

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Inventory System Questions
« on: February 10, 2014, 04:50:06 PM »
Hi,

I'm trying to incorporate the inventory system in the Character X example in my game and I'm having some difficulty.  I have the backback and item slots set up and am able to create items and drag them around from the backpack to the item slots.  However, I'm having difficulty figuring out where I can put my scripts to handle changes in an inventory item slot.  For example, if I drag an inventory item that is a piece of armour onto the armour item slot, where in the code can I call some function that applies the effect of that armour on the character in my game.  I've tried a few different places, but it's not giving me the desired effect.

Would appreciate any guidance.  Many thanks,

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Inventory System Questions
« Reply #1 on: February 10, 2014, 05:47:29 PM »
I would strongly advise you to look at the drag & drop example, and watch the 3.0.7 tutorial video (the end part of it where I create a similar drag & drop scroll views).

Drag & drop stuff was added long after the character inventory example, and is much easier to get into. It also has all the relevant events that you need to work with, for example "OnDragDropRelease" (ExampleDragDropItem.cs).

Rajmahal

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Re: Inventory System Questions
« Reply #2 on: February 10, 2014, 05:56:18 PM »
Thanks ... I'll do that.  The Character X example has really done my head in.    :'(

Rajmahal

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Re: Inventory System Questions
« Reply #3 on: February 10, 2014, 07:24:09 PM »
Actually, I think I figured it out.  I may just continue with it for a bit longer ... though I will go through the new tutorials as I was last using NGUI in the v2.0 days.