Skip to main content

LimitItemCountPlugin.CheckAddFunds

Declaration#

public virtual void CheckAddFunds(GDTKCurrency currency, Int32& count, Boolean& cancel)

Parameters#

NameDescription
currencyCurrency to check
countRequested count which can be updated to reflect approved count
cancelSet true if count changes

Description#

Check if adding funds is allowed

Usage#

using NullSave.GDTK.Inventory;using UnityEngine;
public class Example : MonoBehaviour{
    public void ExampleMethod(Inventory target)    {        GDTKCurrency currency = InventoryDatabase.instance.currencies[0];        int desiredCount = 999;        bool cancel = false;        foreach(InventoryPluginWrapper wrapper in target.plugins)        {            wrapper.plugin.CheckAddFunds(currency, ref desiredCount, ref cancel);            if(cancel)            {                Debug.Log("No funds added.");                return;            }        }
        Debug.Log("Desired count: 999 :: Allowed Count: " + desiredCount);    }}