Skip to content
Snippets Groups Projects
Inventory.cs 1004 B
Newer Older
  • Learn to ignore specific revisions
  • BenniHome's avatar
    BenniHome committed
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    
    
    [CreateAssetMenu(fileName = "New Inventory", menuName= "Inventory System/Inventory" )]
    public class Inventory : ScriptableObject
    
    BenniHome's avatar
    BenniHome committed
    {
    
    BenniHome's avatar
    BenniHome committed
       public List<InventorySlotFact> Facts = new List<InventorySlotFact>();
       public List<InventorySlotScroll> Scrolls = new List<InventorySlotScroll>();
    
    BenniHome's avatar
    BenniHome committed
    
       public void AddFact(ItemObject fact){
    
    BenniHome's avatar
    BenniHome committed
         Facts.Add(new InventorySlotFact(fact));
    
    BenniHome's avatar
    BenniHome committed
       }
    
    
       public void AddScroll(DefaultScroll scroll){
    
    BenniHome's avatar
    BenniHome committed
          Scrolls.Add(new InventorySlotScroll(scroll));
    
    BenniHome's avatar
    BenniHome committed
       }
    }
    
    BenniHome's avatar
    BenniHome committed
    [System.Serializable]
    public class InventorySlotFact{
       public ItemObject item;
       public bool isDisplayed;
    
    BenniHome's avatar
    BenniHome committed
    
    
    BenniHome's avatar
    BenniHome committed
       public InventorySlotFact(ItemObject _item){
          item = _item;
          isDisplayed = false;
       }
    
    }
    
    [System.Serializable]
    public class InventorySlotScroll{
       public DefaultScroll item;
    
    BenniHome's avatar
    BenniHome committed
       public bool isDisplayed;
    
    
    BenniHome's avatar
    BenniHome committed
       public InventorySlotScroll( DefaultScroll _item){
    
    BenniHome's avatar
    BenniHome committed
          item = _item;
          isDisplayed = false;
       }
    }