Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

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.