Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public IEnumerator setMoney(int amount) {
- amount = amount - playerMoney;
- for (int i = 0; i < Mathf.Abs(amount); i++) {
- if (moneyCounting) {
- break;
- }
- if (amount > 0) {
- playerMoney += 1;
- } else {
- playerMoney -= 1;
- }
- yield return new WaitForSeconds(0.01f);
- if (i == Mathf.Abs(amount)) {
- moneyCounting = false;
- }
- }
- }
Add Comment
Please, Sign In to add comment