Exemple #1
0
    private IEnumerator ClearAndCollapseRoutine(IEnumerable <GemBehaviour> matches)
    {
        var complete = false;

        while (!complete)
        {
            GridManager.ClearGems(matches);

            yield return(new WaitForSeconds(0.25f));

            var movedGems = GridManager.CollapseColumns(matches);

            while (!BoardUtils.IsFallComplete(movedGems))
            {
                yield return(null);
            }

            yield return(new WaitForSeconds(SequenceParameters.RefreshMatchCheckDelay));

            matches = GridManager.FindMatchesAt(movedGems);

            if (!matches.Any())
            {
                complete = true;
            }
            else
            {
                yield return(StartCoroutine(ClearAndCollapseRoutine(matches)));
            }
        }
    }