예제 #1
0
    void IncreaseFruitBar()
    {
        if (fruitBarValue < fallenFruitLimit)
        {
            fruitBarValue += cutFruitIncrease;
            if (fruitBarValue > fallenFruitLimit)
            {
                fruitBarValue = fallenFruitLimit;
            }

            float normalizedValue = NormalizeBarValue(fruitBarValue);
            OnFruitBarUpdate?.Invoke(normalizedValue);
        }
    }
예제 #2
0
    void DecreaseFruitBar()
    {
        fruitBarValue -= fallenFruitDecrease;
        if (fruitBarValue <= 0)
        {
            if (fruitBarValue < 0)
            {
                fruitBarValue = 0;
            }

            Lose();
        }

        float normalizedValue = NormalizeBarValue(fruitBarValue);

        OnFruitBarUpdate?.Invoke(normalizedValue);
    }