private void Start()
    {
        UiManager.Instance.action += GameOverBtnsCallBack;
        if (Instance == null)
        {
            Instance = this;
        }
        else
        {
            Destroy(gameObject);
        }

        int cellindex = 0;

        for (int j = 0; j < 7; j++)
        {
            for (int i = 0; i < 6; i++)
            {
                GameBoard[i, j] = CellList[cellindex++];
                Board[i, j]     = 0;
            }
        }

        int buttonIndex = 0;

        for (int i = 0; i < Buttons.Count; i++)
        {
            var current = buttonIndex;
            Buttons[i].onClick.AddListener(() => ButtonCallBack(current));
            buttonIndex++;
        }
        SetPlayer(Player.Human);
    }
示例#2
0
 public ViewResult Game(Game game)
 {
     if (game.ActualGame.GameId == 1)
     {
         game = new FourInARow(game.ActualGame);
     }
     return(View(game));
 }