Exemple #1
0
    private void Update()
    {
        int pointsToAdd = (int)transform.position.y * 10 * (combo + 1);

        if (pointsToAdd > pointsInGame)
        {
            pointsInGame = pointsToAdd;
            pointsCounter.ImmediatelySetText(pointsInGame);
        }

        if (shield)
        {
            if (_actualShieldTime < shieldTime)
            {
                _actualShieldTime += Time.deltaTime;
            }
            else
            {
                DeactivateShield();
            }
        }

        if (_actualBounces > 0)
        {
            _actualComboTime += Time.deltaTime;// / ((Time.deltaTime < 1) ? GetComponent<PlayerAim>().timeSlowDown : 1);
            if (_actualComboTime >= timeToLoseCombo)
            {
                DecreaseCombo();
            }
        }

        if (!_isHurt)
        {
            return;
        }

        _actualHurtTime += Time.deltaTime;

        if (_actualHurtTime <= hurtTime)
        {
            return;
        }

        SetIsHurt(false);
        _actualHurtTime = 0;
    }
 private void Start()
 {
     moneyCounter.ImmediatelySetText(money);
     shopMoneyCounter.ImmediatelySetText(money);
 }