Ejemplo n.º 1
0
    IEnumerator ReselectTileWithDelay(string[] userInput, bool fromLocalUser)
    {
        bool toggle = true;

        if (!canInteract)
        {
            toggle = false;
        }

        canInteract = false;

        if (fromLocalUser)
        {
            gameAudio.PlayOneShot(gameAudio.failedSolveClueAudio, 1.0f);
        }

        UpdateUserGrid();
        int offset = 1;

        if (!currentDirectionIsAcross)
        {
            offset = (int)Mathf.Sqrt(tiles.Length);
        }
        for (int i = 0; i < userInput.Length; i++)
        {
            int index = currentTile.index + i * offset;
            if (userGrid[index] == "")
            {
                TileLogic tl = tiles[index]; //one of the tiles that the user was attempting to fill in
                tl.ShakeLetter(waitToInteractTime - .2f, currentDirectionIsAcross);
            }
        }

        yield return(new WaitForSeconds(waitToInteractTime));

        ShowWordSelected(currentTile, currentDirectionIsAcross);
        if (toggle)
        {
            canInteract = true;
        }
    }