IEnumerator AddMoney() //coroutine pridaj peniaze a.k.a casovac { yield return(new WaitForSeconds(timer)); //počkaj určitý čas (timer) int pomoc = (int)UnityEngine.Random.Range(lowerReward + (lowerReward * player.skill.GetValue() / 10), higherReward + (higherReward * player.skill.GetValue()) / 10); player.AddMoney(pomoc); //po ubehnutí času pridaj hráčovi peniaze }
public void Sell(Item item) { items.Remove(item); character.AddMoney(item.cost / 2); if (onItemChangedCallback != null) { onItemChangedCallback.Invoke(); } item.isBought = false; }