Inventory Object
Inventory Object
Inventory Object
Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
using UnityEditor;
using System.Runtime.Serialization;
}
public InventorySlot SetEmptySlot(Item _item, int _amount)
{
for (int i = 0; i < Container.Items.Length; i++)
{
if(Container.Items[i].ID <= -1)
{
Container.Items[i].UpdateSlot(_item.Id, _item, _amount);
return Container.Items[i];
}
}
//set up functionality for full inventory
return null;
}
[ContextMenu("Save")]
public void Save()
{
//string saveData = JsonUtility.ToJson(this, true);
//BinaryFormatter bf = new BinaryFormatter();
//FileStream file =
File.Create(string.Concat(Application.persistentDataPath, savePath));
//bf.Serialize(file, saveData);
//file.Close();