void OnClickButton3(GameObject go) { if (currentType == EButtonType.InTurn) { bettingDialog = new DialogBetting(GetMaxBinded(), GetMaxRaise(), (money) => { if (currentType == EButtonType.InTurn && PokerObserver.Game.IsMainTurn) { PuSound.Instance.Play(SoundType.RaiseCost); } PokerObserver.Instance.Request(PokerRequestPlay.RAISE, money); }, Array.Find <ButtonItem>(itemButtons, button => button.slot == EButtonSlot.Third).button.transform); DialogBettingView bettingView = GameObject.FindObjectOfType <DialogBettingView>(); if (bettingView == null) { DialogService.Instance.ShowDialog(bettingDialog); } else { PokerObserver.Instance.Request(PokerRequestPlay.RAISE, bettingView.GetCurrentMoney); GameObject.Destroy(bettingView.gameObject); } } else if (currentType == EButtonType.OutGame) { if (PokerObserver.Game.CanBePlay) { PokerObserver.Instance.AutoSitDown(); } else { DialogService.Instance.ShowDialog(new DialogMessage("Thông báo", "Số tiền của bạn không đủ.")); } } }
void OnClickButton3(GameObject go) { if (currentType == EButtonType.InTurn) { bettingDialog = new DialogBetting(GetMaxBinded(), GetMaxRaise(),(money) => { if (currentType == EButtonType.InTurn && PokerObserver.Game.IsMainTurn) PuSound.Instance.Play(SoundType.RaiseCost); PokerObserver.Instance.Request(PokerRequestPlay.RAISE, money); }, Array.Find<ButtonItem>(itemButtons, button => button.slot == EButtonSlot.Third).button.transform); DialogBettingView bettingView = GameObject.FindObjectOfType<DialogBettingView>(); if (bettingView == null) DialogService.Instance.ShowDialog(bettingDialog); else { PokerObserver.Instance.Request(PokerRequestPlay.RAISE, bettingView.GetCurrentMoney); GameObject.Destroy(bettingView.gameObject); } } else if(currentType == EButtonType.OutGame) { if (PokerObserver.Game.CanBePlay) PokerObserver.Instance.AutoSitDown(); else DialogService.Instance.ShowDialog(new DialogMessage("Thông báo", "Số tiền của bạn không đủ.")); } }