示例#1
0
    public IEnumerator DestroyMatches()
    {
        yield return(new WaitForSeconds(.20f));

        int scoreUpdate = 0;

        for (int i = 0; i < height; i++)
        {
            for (int j = 0; j < width; j++)
            {
                if (DestroyMatchesAt(j, i))
                {
                    scoreUpdate += 100;
                    if (!activatedPower)
                    {
                        powerBar.IncreasePowerLevel(1.5f);
                    }
                }
            }
        }
        if (activatedColumnBomb)
        {
            AudioManager.instance.PlayColumnBombSound();
        }
        else if (activatedRowBomb)
        {
            AudioManager.instance.PlayRowBombSound();
        }
        else if (activatedPower)
        {
            AudioManager.instance.PlayPowerUse();
        }
        else
        {
            AudioManager.instance.PlayHitSound();
        }
        activatedColumnBomb = false;
        activatedRowBomb    = false;
        activatedPower      = false;
        dataTracker.UpdateScore(scoreUpdate);
        currentAnimal = null;
        yield return(StartCoroutine(DecreaseRowCo()));
    }