public void AddCurrency() { if (int.TryParse(_currencyAmountInput.text, out int amount)) { _currentWallet.AddCurrency(amount, _currentCurrency); } _currencyAmountInput.text = string.Empty; UpdateCurrencyInfoText(); }
private void ReadXml_Wallet(XmlReader reader) { if (reader.ReadToDescendant("Currency")) { do { Wallet.AddCurrency( reader.GetAttribute("Name"), float.Parse(reader.GetAttribute("Balance"))); }while (reader.ReadToNextSibling("Currency")); } }
public static void NetPackagePlayerInventory_ProcessPackage_Postfix(NetPackagePlayerInventory __instance) { try { if (__instance.Sender != null && Wallet.UpdateRequired.ContainsKey(__instance.Sender.entityId)) { ClientInfo cInfo = __instance.Sender; Wallet.UpdateRequired.TryGetValue(cInfo.entityId, out int value); Wallet.UpdateRequired.Remove(cInfo.entityId); Wallet.AddCurrency(cInfo.CrossplatformId.CombinedString, value); } } catch (Exception e) { Log.Out(string.Format("[SERVERTOOLS] Error in Injections.NetPackagePlayerInventory_ProcessPackage_Postfix: {0}", e.Message)); } }
private void CollectCoin() { _wallet.AddCurrency(1); }