Search Unity

Sleek Inventory - Complete GUI System for Inventories

Discussion in 'Assets and Asset Store' started by Grazer2, Apr 30, 2012.

  1. Grazer2

    Grazer2

    Joined:
    Jun 20, 2011
    Posts:
    86
    I just built a little sample from the description you gave:

    http://download.rarebyte.com/sleekinventory/SleekInventory6_ActionBar.html

    You can use the numbers 1-5 to 'click' on the items of the bottom action bar. You can also use a regular mouse click on them to have them removed.

    The one thing I have to mention is that the interaction between 2 inventories isn't really the best. You have to add quite a bit of code for that. Having them on screen isn't an issue, but dragging from one into the other is a little bit of work. Also, there's still an issue with the drawing order of items. As you can see, when dragging the bottom items across the top left inventory, they are rendered behind the inventory. Can't tell if there's a super clean solution to that issue or if one would have to resolve overriding gui depths depending on which inventory a drag is started on. Being honest: It sure is all possible to do, unfortunately though the dual inventory case isn't as convenient as it could or should be.
     
    Last edited: Mar 25, 2014
  2. Ghosthowl

    Ghosthowl

    Joined:
    Feb 2, 2014
    Posts:
    228
    Ah! That is exactly what I was going for. I just read through your quick start and documentation. As the inventory would be shared and just the windows were seperate I didn't think it would be much of a problem or require any extensive work. I was thinking the hotbar / actionbar on the bottom would work much like the tabs you have for the inventory system (main inventory tab one, action bar tab two) and if need be adding functionality like that another window or so (like a looting window from a container or interaction with an NPC. Though I haven't been able to see the source or design to a varying length so I have no idea.

    Sad to hear it will require a lot of work / effort on part even in its current state. The example you posted is perfect except the render depth as you mentioned. Once I have remedied that and made it so the normal inventory window is easily hideable or closeable. The solution will be perfect for my needs. I guess I will do some more research on other options and or alternatives. But from the looks of my prior research your solution still seemed like one of the best out of all the asset store options. Will have to figure out what I will do and if I will begin building something simple myself and working my way from there one step at a time (something I do not want to do! lol)

    Thanks so much though for the EXCELLENT support and ultra fast response times. By far some of the best asset support I have seen.
     
  3. Grazer2

    Grazer2

    Joined:
    Jun 20, 2011
    Posts:
    86
    You're welcome. As for the code-complexity needed for the web-sample. Find attached to this post the 2 controllers used for the basic inventory and for the bottom action inventory. Note that the code is largely the same, so this could easily be made sleeker (sry for the pun). It was just a quick implementation. The main new code lies in the method InventoryItemDroppedOnTarget of the base inventory controller. That code handles removing the item from the base inventory and adding it to the action bar. Maybe this will help in your decision.
     

    Attached Files:

  4. ldl01031

    ldl01031

    Joined:
    May 1, 2014
    Posts:
    35
    Just bought the package. I don't see any documentation? The '/dev/blog' is not available. Hopefully I don't have only source to go by?

    Thanks in advance,

    -ldl-
     
  5. Grazer2

    Grazer2

    Joined:
    Jun 20, 2011
    Posts:
    86
    Hello there. Sorry for the inconvenience. The dev-page containing the manual is currently down for maintenance. I uploaded the manual to a backup server. You can find it here:

    http://download.rarebyte.com/sleekinventory/docs_backup/sleek_inventory.html

    It's without pictures, but the pictures don't contain important information. Hope you can work with that. Again, sorry. Greetings.
     
  6. ldl01031

    ldl01031

    Joined:
    May 1, 2014
    Posts:
    35
    Awesome. That will get me started!

    Here's a question - can you do a tutorial/example where a character "picks up" an inventory item?

    I hate to sound so noob, but - do all such objects have to be known to the inventory system before they can be picked up? I assume I can attach all the metadata I need to the objects themselves and let a character-script decide what to do with it (add it to inventory and destroy it, add it to inventory and allow it to remain, see that it is already owned and so cannot be added to inventory, etc.).

    I am in fact a noob to Unity but not to software development. I'm still working through how things should be done in Unity.

    Thanks!!

    -ldl-
     
  7. Grazer2

    Grazer2

    Joined:
    Jun 20, 2011
    Posts:
    86
    Here's a simple code snippet that adds a new item to the inventory once you press the 'Add Item' UI button in Play-Mode. You can paste this method into the TestInventoryController_SinglePageInventory class and it'll work in the according example scene.

    Code (csharp):
    1.  
    2.   public void OnGUI() {
    3.     if (GUILayout.Button("Add Item") == true) {
    4.       SleekInventoryTextureContainer textureContainer = this.gameObject.GetComponent<SleekInventoryTextureContainer>();
    5.       ImageItem newItem = new ImageItem(textureContainer.GetTextureByFilename("test_icon_helmet")); //Regular image item.
    6.       testInventory.AddItem(newItem);
    7.     }
    8.   }
    9.  
    So basically you just create a new instance of the item to be added to the inventory, and then invoke AddItem(...) on the inventory. There's no need to pre-register items. Hope this snippet helps. The logic you outlined in your example should be working just fine. Cheers.
     
    Last edited: May 14, 2014