Item and Inventory System - Unity Tutorial - Displaying Inventory Items

  Рет қаралды 6,804

Dapper Dino

Dapper Dino

Күн бұрын

Пікірлер: 11
@kedjpagordoxmc6095
@kedjpagordoxmc6095 4 жыл бұрын
thanks bro! ive struggling with finding good tutorials on unity fundamentals (most just tell how to do one very specific thing and presume that everyone would do exactly that), but now it seems like i found my place :) sorry for the english, its a work in progress
@stacyardus3898
@stacyardus3898 4 жыл бұрын
amazing place to help me start of with a simple yet reliable background, just gotta work out stacking objects now, thanks for the starting point :P
@Bronfit2379
@Bronfit2379 Жыл бұрын
I click on the add object button. And the first slot remains white, all the following slots work fine. Please, help
@Steelersfan355
@Steelersfan355 6 жыл бұрын
great guide! are you planing on doing a tooltip tut as well?
@JB-iz8bi
@JB-iz8bi 4 жыл бұрын
Sorry, but can you make a video on when you enter a GameObject's trigger, the AddItem function is performed and it adds an item to the inventory please? It is a really great tutorial, and thanks for making it.
@sherlyhudson2198
@sherlyhudson2198 5 жыл бұрын
Can you please also implement save and load to the inventory? Its so confusing when it comes to saving an inventory unlike saving strings, ints, float etc. :s
@DapperDinoCodingTutorials
@DapperDinoCodingTutorials 5 жыл бұрын
Have a look at my video about saving game data with scriptable objects. It makes it very easy to save data on something like an inventory so long as the inventory is a scriptable object :)
@sherlyhudson2198
@sherlyhudson2198 5 жыл бұрын
@@DapperDinoCodingTutorials I did check out your video but its a far more complex and advanced system compared to what I want, whereas I only want the inventory system that you can either use item or remove item. Also simply clicking a button should add a item to the inventory, thats all(with save + load system of course). Maybe your tutorial has the answer but because the scope is much bigger its hard to understand for example which scripts are useful for my situation.
@sherlyhudson2198
@sherlyhudson2198 5 жыл бұрын
@@DapperDinoCodingTutorials Can you do a tutorial on it regarding scriptable inventory with save and load? lol my novice brain needs guidance.
@alicewithalex
@alicewithalex 6 жыл бұрын
Cool)
@Redha-wv1fk
@Redha-wv1fk 3 жыл бұрын
Hi bro, can you help me make "save load" to this inventory, i tried many times but without success, i hope you could do it This is the inventory script using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; public class Slot : MonoBehaviour, IPointerClickHandler { private GameObject inventory; public enum property { usable, displayable, empty}; public property ItemProperty { get; set; } private string displayImage; public string combinationItem { get; private set; } void Start() { inventory = GameObject.Find("Inventory"); } public void OnPointerClick(PointerEventData eventData) { inventory.GetComponent().previousSelectedSlot = inventory.GetComponent ().currentSelectedSlot; inventory.GetComponent().currentSelectedSlot = this.gameObject; Combine(); if (ItemProperty == Slot.property.displayable) DisplayItem(); } public void AssignProperty(int orderNumber, string displayImage, string combinationItem) { ItemProperty = (property)orderNumber; this.displayImage = displayImage; this.combinationItem = combinationItem; } public void DisplayItem() { inventory.GetComponent().itemDisplayer.SetActive(true); inventory.GetComponent().itemDisplayer.GetComponent().sprite = Resources.Load("Inventory Items/" + displayImage); } void Combine() { if(inventory.GetComponent().previousSelectedSlot.GetComponent ().combinationItem == this.gameObject.GetComponent().combinationItem && this.gameObject.GetComponent ().combinationItem!= "") { Debug.Log("combine"); GameObject combinedItem = Instantiate(Resources.Load ("Combined Items/" + combinationItem)); combinedItem.GetComponent().ItemPickUp(); inventory.GetComponent().previousSelectedSlot.GetComponent().ClearSlot(); ClearSlot(); } } public void ClearSlot() { ItemProperty = Slot.property.empty; displayImage = ""; combinationItem = ""; transform.GetChild(0).GetComponent().sprite = Resources.Load("Inventory Items/empty_item"); } } AND THIS IS THE SLOTS SCRIPT using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; public class Slot : MonoBehaviour, IPointerClickHandler { private GameObject inventory; public enum property { usable, displayable, empty}; public property ItemProperty { get; set; } private string displayImage; public string combinationItem { get; private set; } void Start() { inventory = GameObject.Find("Inventory"); } public void OnPointerClick(PointerEventData eventData) { inventory.GetComponent ().previousSelectedSlot =inventory.GetComponent ().currentSelectedSlot; inventory.GetComponent().currentSelectedSlot = this.gameObject; Combine(); if (ItemProperty == Slot.property.displayable) DisplayItem(); } public void AssignProperty(int orderNumber, string displayImage, string combinationItem) { ItemProperty = (property)orderNumber; this.displayImage = displayImage; this.combinationItem = combinationItem; } public void DisplayItem() { inventory.GetComponent().itemDisplayer.SetActive(true); inventory.GetComponent().itemDisplayer.GetComponent().sprite = Resources.Load("Inventory Items/" + displayImage); } void Combine() { if(inventory.GetComponent().previousSelectedSlot.GetComponent ().combinationItem == this.gameObject.GetComponent().combinationItem && this.gameObject.GetComponent ().combinationItem!= "") { Debug.Log("combine"); GameObject combinedItem = Instantiate(Resources.Load ("Combined Items/" + combinationItem)); combinedItem.GetComponent().ItemPickUp(); inventory.GetComponent().previousSelectedSlot.GetComponent().ClearSlot(); ClearSlot(); } } public void ClearSlot() { ItemProperty = Slot.property.empty; displayImage = ""; combinationItem = "";`enter code here` transform.GetChild(0).GetComponent().sprite = Resources.Load("Inventory Items/empty_item"); } }
A Behind the Scenes look into my Game's Development
24:50
Dapper Dino
Рет қаралды 865
Haunted House 😰😨 LeoNata family #shorts
00:37
LeoNata Family
Рет қаралды 15 МЛН
Car Bubble vs Lamborghini
00:33
Stokes Twins
Рет қаралды 44 МЛН
Items & Inventory in Unity (pt.1) - Start Simple
8:55
Kryzarel
Рет қаралды 102 М.
Creating a Custom Tab System in Unity
13:45
Game Dev Guide
Рет қаралды 236 М.
INVENTORY TUTORIAL IN UNITY 2019! | Beginner Friendly
20:17
Item and Inventory System - Unity Tutorial - Picking Up Items
23:10
Unity3D - Scriptable Object Inventory System | Part 1
31:31
Make Videos Like 3Blue1Brown | Manim
9:32
Darwin Tech
Рет қаралды 177 М.
Haunted House 😰😨 LeoNata family #shorts
00:37
LeoNata Family
Рет қаралды 15 МЛН