/// <summary> /// Whenever you buy something in the store, this function is called upon successfully taking the player's currency /// Determine what the player did in the store and then call an appropriate function to complete the action /// </summary> /// <param name="response">The response from the server contains(in order): /// 1. What action the user took in the store: Upgrade a stat, unlock a weapon or buy ammo /// 2. For upgrades: Which stat; For unlocks: which weapon /// 3. For upgrades: To what level /// 4. for upgrades: Which weapon</param> void OnSpentCurrency(MBSEvent response) { string [] args = response.details [0].String("meta").Split(','); switch (args [0].ToLower().Trim()) { case "upgrade": int amt = int.Parse(args [2]); int type = int.Parse(args [3]); UpgradeStat(args [1], amt, type); break; case "unlock": UnlockWeapon(int.Parse(args [1])); break; case "ammo": int qty = int.Parse(args [1]); int ammo_type = int.Parse(args [2]); UpdateAmmo(qty, ammo_type); break; } }
void UpdateGUI(MBSEvent response) { WULogin.fetched_info.Set(WULogin.CurrencyString("dust"), response.details [0].String()); ShowCoins(); }
void OnWUMErrorReceived(MBSEvent response) { print(response.details[0].String("Message")); WUMoney.GetCurrencyBalance("dust"); }
void UpdateCurrency(MBSEvent response) { string currency_name = response.details [0].String("currency"); WULogin.fetched_info?.Seti(WULogin.CurrencyString(currency_name), response.details [0].Int()); }
void CurrencyError(MBSEvent response) => StatusMessage.Message = response.details [0].String("message");
void OnPointsEarned(MBSEvent response) => WULogin.fetched_info?.Seti(WULogin.CurrencyString("dust"), response.details [0].Int("total"));