void OnBtnConfirmClick() { if (_canConfirm == false) { _CurrentInputField.text = ""; return; } int inputmoney; try { inputmoney = int.Parse(_CurrentInputField.text); } catch (Exception e) { _CurrentInputField.text = ""; return; } if (inputmoney <= 0) { _CurrentInputField.text = ""; return; } if (!ATMTaskManager._Instance.CheckMoney(inputmoney)) { _CurrentInputField.text = ""; ++WrongMoney; MoneyInCorrect(); return; } int outmoney = CardUserManager.TransferOutByID(ATMScreenManager._Instance.CurrentCardUser.UserID, inputmoney); if (outmoney > 0) { CardUserManager.TransferInCard(ATMScreenTransfer._Instance._targetId, outmoney); } //紀錄轉帳總錯誤次數 ATMDataManager.Instance.WrongNumber = ATMScreenInputPassWord.WrongPassword + ATMScreenTransferFirst.WrongAccount + WrongMoney; ATMTaskManager._Instance.TaskDone(TASKTYPE); ATMScreenTransfer._Instance._transfermoney = outmoney; ATMScreenTransfer._Instance.SetGOActive(3); }
void OnBtnConfirmClick() { if (_TextTransferInValue.text == "") { return; } else { int money = int.Parse(_TextTransferInValue.text); if (CardUserManager.TransferInCard(ATMScreenManager._Instance.CurrentCardUser.UserID, money)) { Debug.LogError("存钱成功"); _TextTransferInValue.text = 0 + ""; } else { Debug.LogError("存钱失败"); } } }