The Code example in Inventory seems invalid

serenity

Member
There seems to be a problem with the below code:

Code:
using UnityEngine;
using Opsive.Shared.Inventory;
using Opsive.Shared.Events;

public class MyObject : MonoBehaviour
{
    public void Awake()
    {
        EventHandler.RegisterEvent<IItemIdentifier, int>(gameObject, "OnInventoryAdjustItemIdentifierAmount", OnAdjustItemIdentifierAmount);
    }

    /// <summary>
    /// The specified ItemIdentifier has changed values.
    /// </summary>
    /// <param name="itemIdentifier">The ItemIdentifier that has been used.</param>
    /// <param name="remaining">The remaining amount of the specified ItemIdentifier.</param>  
    private void OnInventoryAdjustItemIdentifierAmount(IItemIdentifier itemIdentifier, int remaining)
    {
        Debug.Log("The inventory used " + itemIdentifier + ", " + remaining + " is remaining.");
    }

    public void OnDestroy()
    {
        EventHandler. UnregisterEvent <IItemIdentifier, int>(gameObject, "OnInventoryAdjustItemIdentifierAmount", OnAdjustItemIdentifierAmount);
    }
}



Especially the Using statements at the top returns errors:

Code:
using Opsive.Shared.Inventory;
using Opsive.Shared.Events;
 
Ah ok I will find another workaround since I cannot upgrade at this time in development as my game will be Pre-Alpha released in a couple week
 
Top