Exemplo n.º 1
0
    public void Setup(int[] numbers)
    {
        Debug.Assert(tiles != null);

        if (numbers == null)
        {
            Clear();

            return;
        }

        for (int i = 0, max = Mathf.Min(tiles.Length, numbers.Length); i < max; ++i)
        {
            HexaTile tile = tiles[i];
            if (tile != null)
            {
                NumberedHexaCell cell = null;
                if (numbers[i] > 0)
                {
                    cell = GameManager.instance.GenerateHexaCell() as NumberedHexaCell;
                    if (cell != null)
                    {
                        cell.Setup(numbers[i]);
                    }
                }

                tile.SetCell(cell);
            }
        }

        _highestNumber = GetCurrentHighestNumberOnBoard();

        _combineEffectBuffer.Withdraw();
        _explodeEffectBuffer.Withdraw();
    }