/// <summary> /// 还贷 /// </summary> /// <returns></returns> public void PayLoans(out List <UserLoansBean> listPayLoans) { listPayLoans = new List <UserLoansBean>(); if (CheckUtil.ListIsNull(listLoans)) { return; } for (int i = 0; i < listLoans.Count; i++) { UserLoansBean itemLoans = listLoans[i]; if (HasEnoughMoney(0, 0, itemLoans.moneySForDay)) { //支付金钱 PayMoney(0, 0, itemLoans.moneySForDay); //剩余的还贷日期-1 itemLoans.residueDays -= 1; //已经还过的列表+1 listPayLoans.Add(itemLoans); //如果已经还完 if (itemLoans.residueDays <= 0) { listLoans.Remove(itemLoans); i--; } } } }
public void SetData(UserLoansBean loansData) { this.loansData = loansData; SetLoansMoney(loansData.moneyS); SetLoansRate(loansData.loansRate); SetLoansDays(loansData.loansDays); SetMoneyForDay(loansData.moneySForDay); }
/// <summary> /// 增加贷款 /// </summary> /// <param name="loans"></param> /// <returns></returns> public bool AddLoans(UserLoansBean loans) { if (listLoans.Count >= loansNumberLimit) { return(false); } else { listLoans.Add(loans); return(true); } }
public void CreateLoansData() { CptUtil.RemoveChildsByActive(objLoansContainer); GameDataBean gameData = GameDataHandler.Instance.manager.GetGameData(); InnAttributesBean innAttributes = gameData.GetInnAttributesData(); //获取客栈等级 innAttributes.GetInnLevel(out int levelTitle, out int levelStar); //根据等级生成不同数量的贷款项目 int loansNumber = (levelTitle == 0 ? 1 : (levelTitle - 1) * 5 + levelStar + 1); for (int i = 0; i < loansNumber; i++) { GameObject objLoans = Instantiate(objLoansContainer, objLoansModel); ItemTownBankLoansCpt itemLoans = objLoans.GetComponent <ItemTownBankLoansCpt>(); UserLoansBean userLoans = new UserLoansBean(2000 * (i + 1) * 2, 0.15f + i * 0.02f, 10); itemLoans.SetData(userLoans); objLoans.transform.DOScale(new Vector3(0, 0, 0), 0.5f).SetDelay(i * 0.1f).SetEase(Ease.OutBack).From(); } }