Esempio n. 1
0
    public void Init(BoardInfo i)
    {
        info        = i;
        gameBoard   = new TileSpace[info.col, info.row];
        emptySpaces = info.col * info.row;
        int tileNum = 0;

        for (int x = 0; x < info.col; x++)
        {
            for (int y = 0; y < info.row; y++)
            {
                float     xPos    = x * _tileOffset;
                float     yPos    = y * _tileOffset;
                Vector3   tilePos = new Vector3(xPos, yPos, 0);
                TileSpace tile    = Instantiate(Services.Prefabs.Tile, tilePos, Quaternion.identity, transform);
                tile.name = "TileSpace X: [" + x + ", " + y + "]";
                tile.Init(x, y, tileNum);
                gameBoard[x, y] = tile;
                tile.gameObject.SetActive(false);
                tileNum++;
            }
        }

        EstablishWinningSets();
        Services.EventManager.Register <PlayMadeEvent>(OnPlayMade);

        Task entryAnimation = new BoardEntryAnimation(true);

        _tm.Do(entryAnimation);
    }
Esempio n. 2
0
 public PlayMadeEvent(Player p, TileSpace ts)
 {
     player    = p;
     tileSpace = ts;
 }