protected void insertWildcard(Cell cell)
    {
        Letter letter        = wordManager.getNewEmptyGridLetter();
        Letter contentLetter = null;

        wordManager.setValuesToWildCard(letter, ".");

        if (cell.content)
        {
            contentLetter = cell.content.GetComponent <Letter> ();

            if (contentLetter != null)
            {
                if (contentLetter.selected)
                {
                    wordManager.removeLetter(contentLetter.letterReference);
                    wordManager.arrangeSortingOrder();
                }
                gameManager.getGridCharacters().Remove(contentLetter);
            }
        }

        //cell.destroyCell ();

        keyBoardManager.setSelectedWildCard(letter);
        cellsManager.occupyAndConfigureCell(cell, letter.gameObject, Piece.EType.LETTER, Piece.EColor.NONE, true);
        gameManager.getGridCharacters().Add(letter);
    }
Esempio n. 2
0
    public void OnGridLetterTapped(GameObject go, bool byDrag)
    {
        Letter letter = go.GetComponent <Letter>();

        if (letter.isPreviouslySelected())
        {
            if (byDrag)
            {
                return;
            }
            //Se va eliminar
            removeLetter(letter.letterReference);
            arrangeSortingOrder();
            StartCoroutine(correctTweens());

            deselectSound();
        }
        else
        {
            //Se va agregar
            if (isAddLetterAllowed())
            {
                if (!letter.wildCard)
                {
                    if (!byDrag)
                    {
                        StartCoroutine(correctTweens());
                        addLetterFromGrid(letter);
                    }
                    else
                    {
                        addLetterFromGrid(letter, byDrag);
                    }
                }
                else
                {
                    keyBoard.setSelectedWildCard(letter);
                    keyBoard.showKeyBoardForWildCard();
                }
            }
        }
    }