Exemple #1
0
    private void create()
    {
        if (null == PrefCellPanel)
        {
            Log.Error("not found prefab cell panel");
            return;
        }

        BoardGame.Board board = Manager.Instance.Object.BoardGameMode.Board;

        for (int row = 0; row < BoardGame.Board.SIZE; ++row)
        {
            for (int col = 0; col < BoardGame.Board.SIZE; ++col)
            {
                GameObject o = Instantiate(PrefCellPanel);
                o.transform.SetParent(transform, false);

                CellPanel p = o.GetComponent <CellPanel>();
                p.Set(board.Get(row, col));
            }
        }
    }