Пример #1
0
    private void ControlPowerUps()
    {
        //if the high jump power-up runs out, disable high jump
        if (_highJumpEnabled && Time.time > _highJumpEnds)
        {
            _highJumpEnabled = false;
            Destroy(_currentParticleEffectHJ);
        }

        //if the double points power-up runs out, set point multiplier to 1
        if (_pointMultiplier > 1 && Time.time > _doublePointsEnds)
        {
            Destroy(_currentParticleEffectMult);
            _pointMultiplier = 1;
        }

        //if the freeze power-up runs out, set water to unfrozen
        if (WaterController.isWaterFrozen() && Time.time > _freezeEnds)
        {
            WaterController.Unfreeze();
        }

        //if the jetpack power-up runs out, disable jetpack
        if (_jetpackEnabled && Time.time > _jetpackEnds)
        {
            Destroy(_currentJetPackEffect);
            _jetpackEnabled = false;
            Anim.SetBool("JetPack", false);
        }

        //if the hoover power-up runs out, disable hoover
        if (HooverEnabled && Time.time > _hooverEnds)
        {
            Destroy(_currentVacuumEffect);
            Anim.runtimeAnimatorController = withoutVacuumAnimator;
            HooverEnabled = false;
            Debug.Log("Hoover disabled");
            //     Anim.runtimeAnimatorController = withoutVacuum;
            Anim.SetBool("JetPack", _jetpackEnabled);
        }
    }