// 更新数据 internal void UpdateItemsData(JSONNode jSONNode) { if (jSONNode.IsNull || jSONNode.Equals(itemsDataNode)) { return; } itemsDataNode = jSONNode; }
private async System.Threading.Tasks.Task <bool> CreatePaymentMethodAsync(string card_number, string cvc, int card_expiry_month, int card_expiry_year) { string token = UserManager.Get.getCurrentSessionToken(); string _paymentMethodID = await ChargeManager.Get.CreatePaymentMethodAsync(CardNumber.text, CVV.text, card_expiry_month, card_expiry_year); if (!_paymentMethodID.Equals("-1")) { JSONNode _paymentIntent = await ChargeManager.Get.CreatePaymentIntentAsync(_paymentMethodID, WalletScript.LastCredit, token); if (!_paymentIntent.Equals("-1")) { _paymentIntentID = _paymentIntent["data"]["id"].Value; if (_paymentIntent["success"].AsBool) { if (Is3DSecure(_paymentIntent)) { Confirm3DSecure(_paymentIntent); } else { if (_paymentIntent["status"].Value == ChargeManager.PAYMENT_STATUS_SUCCEEDED) { ChargeSucceeded(); } else { ChargeCanceled(); } } } else { ChargeCanceled(); } } } else { UnloadBankingInfo(); } return(true); }
public IEnumerator say(string index, bool isPlayer) { JSONNode dialogueSet = getProperDialogueSet(isPlayer); JSONNode conditon = dialogueSet [index] [CONDITION_KEY]; if (!conditon.Equals(null)) { Debug.Log("A"); Debug.Log(conditon); Debug.Log(!eventHasHappened(conditon)); if (!eventHasHappened(conditon)) { Debug.Log("B"); StartCoroutine(say(dialogueSet [index][ALTERNATE_KEY], isPlayer)); yield break; } } JSONNode applyCondition = dialogueSet [index] [APPLY_CONDITION_KEY]; if (applyCondition.Count > 0) { recordEvent(applyCondition [0], applyCondition [1].AsBool); Debug.Log("Applying condition " + applyCondition[0]); } string subtitle = dialogueSet [index] [TEXT_KEY]; AudioClip audio = getProperVoiceSet(isPlayer)[index]; uiDialogue.displaySubtitle(subtitle); audioSource.clip = audio; audioSource.Play(); yield return(new WaitForSeconds(audio.length + pauseBetweenLines)); string nextLine = dialogueSet[index][NEXT_KEY]; string[] ids = toStringArray(dialogueSet[index][RESPONSE_KEY].AsArray); if (nextLine != null && nextLine.Length > 0) { StartCoroutine(say(nextLine, isPlayer)); } else if (ids.Length > 1) { // Player will only ever get to make choices // so we know this must be a player-controlled choice uiDialogue.showOptions(getOptionsText(index, ids), ids, this); } else if (ids.Length == 1) { // This could be player or an NPC so just flip isPlayer and speak StartCoroutine(say(ids[0], !isPlayer)); } else if (ids.Length == 0) { endDialogue(); } }