IEnumerator TakeDamageInSunLight() { print("in sun light"); while (graceTimer < gracePeriod) { yield return(null); } player.InSun = true; while (inSunlight && !playerStats.IsDead) { print("sunDamage taken: " + damagePerTick); playerStats.DecreaseHealthValue(damagePerTick); yield return(new WaitForSeconds(sunDamageTickRate)); } }
public void LoseHealth(int health) { playerStatsManager.DecreaseHealthValue(health); }