Search Unity

Tutorial - Inventory- and Craft System with the new UI System 4.6

Discussion in 'Community Learning & Teaching' started by Sander1991, Sep 10, 2014.

  1. Sander1991

    Sander1991

    Joined:
    Aug 25, 2014
    Posts:
    162
    Hey,

    I have started a tutorial series where I create a Inventory- and Craft-System with the new UI System.
    Craft System(works with inventory):
    • Part 1(Creating the whole craft system):

    • Part 2:


    PS.: Im sorry for my bad english I hope it is good enough for you guys ;). Ask if you have some questions.
     
  2. ThirdEyeCyclops

    ThirdEyeCyclops

    Joined:
    Mar 5, 2014
    Posts:
    7
    This looks great! Thanks for the tutorials mate. When the new UI gets released I'll be sure to use your videos as a reference.
     
  3. Mr.T

    Mr.T

    Joined:
    Jan 1, 2011
    Posts:
    546
    Hi, Thanks for the tutorial

    I have a problem.
    OnPointerDown is not working for me in the SlotScript your first tutorial

    EDIT 1:
    Sander,
    Right now I am going through the new official UI Tutorials here
    http://unity3d.com/learn/tutorials/modules/beginner/ui/ui-canvas

    To check whether the new UI even works in my Windows XP system. Perhaps it may be a fault with my system. Will get back to you later.

    EDIT 2:
    My problem solved now !!
    I had accidentally deleted the Events System. How idiotic of me :eek:
    Sorry for the disturbance. This whole thing is new to me
     
    Last edited: Sep 16, 2014
  4. Reaxgrim

    Reaxgrim

    Joined:
    Feb 15, 2014
    Posts:
    16
    got problem with this. on Part 5.
    the Stacking part.

    the consumables just vanish.

    this is my code and as i can tell its an exact to your own.

    Code (csharp):
    1.  
    2.     public void checkIfItemExist(int itemID, Item item)
    3.     {
    4.         for (int i = 0; i < Items.Count; i++)
    5.         {
    6.             if (Items[i].itemID == itemID)
    7.             {
    8.  
    9.                 Items[i].itemValue = Items[i].itemValue + 1;
    10.                 Debug.Log("running i");
    11.                 break;
    12.  
    13.             }
    14.             else if (i == Items.Count - 1)
    15.             {
    16.                 AddItemAtEmptySlot(item);
    17.                 Debug.Log("running i else");
    18.             }
    19.         }
    20.     }
    21.  
    22.  
    and

    Code (csharp):
    1.  
    2.     void addItem(int id)
    3.     {
    4.         for (int k = 0; k < database.items.Count; k++)
    5.         {
    6.             if (database.items[k].itemID == id)
    7.             {
    8.                 Item item = database.items[k];
    9.  
    10.                 if (database.items[k].itemType == Item.ItemType.Consumable)
    11.                 {
    12.  
    13.                     checkIfItemExist(id,item);
    14.                     break;
    15.  
    16.                 }
    17.                 else
    18.                 {
    19.                     AddItemAtEmptySlot(item);
    20.                 }
    21.             }
    22.         }
    23.     }
    24.  
    25.