LimitWeightPlugin.CheckAddFunds
Declaration#
public virtual void CheckAddFunds(GDTKCurrency currency, Int32& count, Boolean& cancelAdd)Parameters#
| Name | Description |
|---|---|
| currency | Currency to check |
| count | Requested count which can be updated to reflect approved count |
| cancelAdd | Set 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); }}