Esempio n. 1
0
    public void AddCombo()
    {
        comboCounter++;
        if (comboCounter > 1)
        {
            comboLabel.text = comboCounter.ToString();
            //Ate 100 combos, o tempo pra combar diminue
            comboTimerCounter = 2f + Mathf.Max(0, (1 - (comboCounter * 0.01f)));

            if (!comboOnCooldown)
            {
                StartCoroutine(RunComboCooldown());
                if (!comboRunning)
                {
                    comboRunning = true;
                    comboHolder.SetActive(true);
                    comboLabelAlphaTween = TweenAlpha.Begin(comboLabelGO, 0.2f, 1);
                    comboLabelAlphaTween.ignoreTimeScale = false;
                    TweenAlpha.Begin(comboLabelHitsGO, 0.2f, 1).ignoreTimeScale = false;
                    StopCoroutine("FinishCombo");
                    StartCoroutine("FinishCombo");
                }
                comboEffects.SpawnLocal(Vector3.zero, Quaternion.identity);
                comboLabelTrans.localScale           = comboLabelIniScale * 1.5f;
                comboLabelScaleTween                 = TweenScale.Begin(comboLabelGO, 0.2f, comboLabelIniScale);
                comboLabelScaleTween.ignoreTimeScale = false;
            }
        }
    }