public override void OnEnter() { if (amount.Value > 0f) { collection.AddCurrency((uint)currencyID.Value, amount.Value); } else if (amount.Value < 0f) { collection.RemoveCurrency((uint)currencyID.Value, Mathf.Abs(amount.Value), true); } Finish(); }
public void TriggerAddCurrencyToCollection(ItemCollectionBase collection) { InventoryManager.instance.intValDialog.ShowDialog(transform, "Amount", "", 1, 9999, value => { // Yes callback if (InventoryManager.CanRemoveCurrency(currencyID, (float)value, allowCurrencyConversions)) { InventoryManager.RemoveCurrency(currencyID, value); toCollection.AddCurrency(currencyID, value); } }, value => { // No callback } ); }