Пример #1
0
    void Update()
    {
        UpdateMeters();
        CommunicateWithShop();

        // death
        if (currentHealth <= 0)
        {
            currentHealth = 0;
            SetConstantHealthRegen(false, 0);
            healthToRestore = 0;
            Death();
        }

        // curse and first aid
        if (hasFirstAidKit == true && cursed == true)
        {
            hasFirstAidKit = false;
            cursed         = false;
            refPlayerAudio.PlayCursed(1.25f);
        }

        // stopping the health restoration coroutine
        if (healthToRestore == 0)
        {
            StopCoroutine("RestoreHealth");
        }

        if (readyToRestart == true && Input.GetButtonDown("Jump"))
        {
            ReloadScene();
        }

        refMusicManager.SetWobble(cursed);
    }