Beispiel #1
0
    public Letter getGridLetterFromPool(EPoolType poolType)
    {
        Letter result = null;

        switch (poolType)
        {
        case EPoolType.NORMAL:
            result = createGridLetter(lettersPool.getNextRandomized());
            break;

        case EPoolType.OBSTACLE:
            result = createGridLetter(obstaclesLettersPool.getNextRandomized());
            break;

        case EPoolType.TUTORIAL:
            result = createGridLetter(tutorialLettersPool.getNextRandomized());
            break;
        }

        return(result);
    }
    public void initializePiecesToShow(bool randomPieces = true)
    {
        if (randomPieces)
        {
            for (int i = 0; i < piecesToShow; i++)
            {
                showingPieces.Add(GameObject.Instantiate(piecesPrefab.getNextRandomized()).GetComponent <Piece> ());
                showingPieces [i].gameObject.SetActive(true);
                showingPieces [i].createdIndex = i;
            }
        }
        else
        {
            for (int i = 0; i < piecesToShow; i++)
            {
                showingPieces.Add(GameObject.Instantiate(piecesPrefab.getNext()).GetComponent <Piece> ());
                showingPieces [i].gameObject.SetActive(true);
                showingPieces [i].createdIndex = i;
            }
        }

        piecesShowedCount = piecesToShow;
    }