Ejemplo n.º 1
0
    void AddTileColumn(GameObject tile, int column, int times, int side)
    {
        //Debug.Log(Time.frameCount + "AddTile: " + tile.name + ", column = " + column + ", " + times + " times" + " side = " + side);
        SideController currentSide = currentBoard.GetSide(side);

        //Debug.Log("Current side = " + currentSide.name);

        if (column >= currentSide.NumColumns())
        {
            //Debug.Log("Adding a new column");
            currentSide.AddColumn();
        }

        ColumnController currentColumn = currentSide.GetCurrentColumn();

        //Debug.Log(Time.frameCount + "AddTile: currentColumn = " + currentColumn);
        CardController currentCard = currentColumn.GetCard();

        for (int i = 0; i < times; i++)
        {
            if (i != 0)
            {
                tile = Instantiate(tile);
            }
            tile.name = tile.GetComponent <TileController>().number + " " + Random.Range(0.1f, 100f);
            //Debug.Log(Time.frameCount + "AddTile: adding tile " + tile + " " + tile.transform.lossyScale);
            currentCard.AddTile(tile.GetComponent <TileController>());
        }
    }