コード例 #1
0
    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));
        }
    }
コード例 #2
0
 public void LoseHealth(int health)
 {
     playerStatsManager.DecreaseHealthValue(health);
 }