// Callback for saving private static void handleCurrencySave(IAPObject obj) { //Debug.Log("handleCurrencySave: " + obj); _datastore.SetValue("currencyList", obj.uid, obj.data); _datastore.Save(); if (OnCurrencyUpdated != null) { OnCurrencyUpdated.Invoke(obj as IAPCurrency); } }
private void OnSuccess(JSONObject data) { coins = data.keys.Contains("coins") ? Int32.Parse(data["coins"].ToString()) : 0; gems = data.keys.Contains("gems") ? Int32.Parse(data["gems"].ToString()) : 0; OnCurrencyUpdated?.Invoke(coins, gems); }