示例#1
0
    public IEnumerator CheckMoveCo()
    {
        if (isColorBomb)
        {
            //This piece is a color bomb, and the other piece is the color to destroy
            findMatches.MatchPiecesOfColor(otherDot.tag);
            isMatched = true;
        }
        else if (otherDot.GetComponent <Dot>().isColorBomb)
        {
            //The other piece is a color bomb, and this piece has the color to destroy
            findMatches.MatchPiecesOfColor(this.gameObject.tag);
            otherDot.GetComponent <Dot>().isMatched = true;
        }
        yield return(new WaitForSeconds(.5f));

        if (otherDot != null)
        {
            if (!isMatched && !otherDot.GetComponent <Dot>().isMatched)
            {
                otherDot.GetComponent <Dot>().row    = row;
                otherDot.GetComponent <Dot>().column = column;
                row    = previousRow;
                column = previousColumn;
                yield return(new WaitForSeconds(.5f));

                board.currentDot   = null;
                board.currentState = GameState.move;
            }
            else
            {
                if (endGameManager != null)
                {
                    if (endGameManager.requirements.gameType == GameType.Moves)
                    {
                        endGameManager.DecreiceCounterValue();
                    }
                }
                board.DestroyMatches();
            }
            //otherDot = null;
        }
    }