public void StartBet() { clearBet(); betAmount = Int32.Parse(betAmountInput.text); numberOfMine = Int32.Parse(noMineInput.text); GrdManager.Instance.CallServerScript("mines", "newgame", new object[] { betAmount, numberOfMine }, (error, data) => { if (error == 0) { MinesResponse result = MiniJSON.Json.GetObject <MinesResponse>(data); if (result.error == 0) { gameTable.InitTable(result, MinesTileStatus.HIDDEN); numberOfMine = result.mines; infoPanel.UpdateMines(numberOfMine); currentGameId = result.gameid; if (betAmount > 0) { GrdManager.Instance.User.balance = GrdManager.Instance.User.balance - (decimal)result.bet; balancePanel.UpdateBalance((double)GrdManager.Instance.User.balance); } OnStartPlay(); } } else { Debug.Log(data); } }); }