Example #1
0
    // randomizes buttons for input
    protected void randomizePuzzle()
    {
        tileLocations = new ArrayList();

        for (int i = 0; i < inputButtons.Count; i++)
        {
            GameObject matchingPiece = inputButtons[i] as GameObject;
            Image[]    allTileImages = matchingPiece.GetComponentsInChildren <Image>();

            foreach (Image allTileImage in allTileImages)
            {
                allTileImage.enabled = true;
            }

            MatchingTilePiece tilePiece = matchingPiece.GetComponent <MatchingTilePiece>();
            tilePiece.setRandomTile(correctTileSpaces);

            if (i < amountOfCorrectTiles)
            {
                setCorrectImageTile(((GameObject)correctTileImages[i]).GetComponent <MatchingTilePiece>(), tilePiece.TileSpaces);
            }

            setMatchingListeners(matchingPiece, tilePiece.TileSpaces);
        }

        randomizeTileLocations();
    }
Example #2
0
 protected void setCorrectImageTile(MatchingTilePiece correctTilePiece, int[] tileImages)
 {
     correctTilePiece.setCorrectTile(tileImages);
     correctTileSpaces.Add(tileImages);
     correctTilePiece.gameObject.GetComponent <Image>().color = CORRECT_DEFAULT_COLOR;
 }