For some reason if i create a pickupspawner with an actionitem and pick that item up and save. When i reload the actionitem is gone from my inventory. All other items are saved and stays in my inventory.
I havent done anything to the actionitem script. For some reason if I put out several health potions pick em up and save and reload the potions are gone but the red dot with the number is still in the slot.
if i try to use the empty action slot the item was saved in which is now empty i get a nullreferenceexception. So something is there but what?
using System;
using UnityEngine;
namespace GameDevTV.Inventories
{
/// <summary>
/// An inventory item that can be placed in the action bar and "Used".
/// </summary>
/// <remarks>
/// This class should be used as a base. Subclasses must implement the `Use`
/// method.
/// </remarks>
[CreateAssetMenu(menuName = ("GameDevTV/GameDevTV.UI.InventorySystem/Action Item"))]
public class ActionItem : InventoryItem
{
// CONFIG DATA
[Tooltip("Does an instance of this item get consumed every time it's used.")]
[SerializeField] bool consumable = false;
// PUBLIC
/// <summary>
/// Trigger the use of this item. Override to provide functionality.
/// </summary>
/// <param name="user">The character that is using this action.</param>
public virtual void Use(GameObject user)
{
Debug.Log("Using action: " + this);
}
public bool isConsumable()
{
return consumable;
}
}
}