예제 #1
0
파일: Player.cs 프로젝트: tvance989/umbra
    void PickUpPickup(GameObject pickup)
    {
        audio.PlayOneShot(pickupSound, 0.1f);
        Destroy(pickup);

        ScoreManager.instance.AddScore(10);
        healthBar.value += 10;
        levelBar.value  += 10;

        pickupSpawner.SpawnRandomPickup();         //.this doesn't belong in the player class

        //.figure out better way to increase difficulty
        if (ScoreManager.instance.GetScore() >= level * 100)
        {
            audio.PlayOneShot(levelUpSound, 0.4f);
            level++;
            levelBar.value = 0;

            sunburnDamage = Mathf.Lerp(minSunburnDamage, maxSunburnDamage, (float)ScoreManager.instance.GetScore() / 1000f);
            flareDamage   = Mathf.Lerp(minFlareDamage, maxFlareDamage, (float)ScoreManager.instance.GetScore() / 1000f);

            Debug.Log("Level " + level + "; sunburn dmg " + sunburnDamage + "; flare dmg " + flareDamage);
        }
    }