/// <summary> /// 重置 /// </summary> public void Reset() { BetMoney = 0; CurGameType = PlayerGameType.None; ReadyState = false; WinEffect.SetActive(false); GameType.gameObject.SetActive(false); Blinds.SetActive(false); UserBetPoker.Reset(); BetLabel.text = string.Empty; BetLabel.gameObject.SetActive(false); }
/// <summary> /// 玩家下注 /// </summary> public void PlayerBet(long money, bool changeRoomG = true) { var gameUserInfo = GetData <YxBaseGameUserInfo>(); if (gameUserInfo == null) { YxDebug.LogError("没有用户信息!!"); return; } if (money <= 0) { return; } BetMoney += money; var gMgr = App.GetGameManager <TexasGameManager>(); var bets = gMgr.BetMagr.CreatBetArray(money, 4, transform); var gdata = App.GetGameData <TexasGameData>(); for (var i = 0; i < bets.Length; i++) { var bet = bets[i].GetComponent <Bet>(); bet.BeginMove(bet.transform.localPosition, BetLabel.transform.localPosition, i * gdata.BetSpeace, BetFinishedType.Hide, () => { BetLabel.gameObject.SetActive(true); }); Bets.Add(bet); } BetLabel.text = YxUtiles.ReduceNumber(BetMoney); Facade.Instance <MusicManager>().Play("bet"); if (changeRoomG) { RoomCoin -= money; } if (gameUserInfo.RoomCoin <= 0) { Facade.Instance <MusicManager>().Play("allin"); CurGameType = PlayerGameType.AllIn; } else { CurGameType = PlayerGameType.Call; } }
/// <summary> /// 重置 /// </summary> public void Reset() { BetMoney = 0; foreach (Bet bet in Bets) { if (bet != null && bet.gameObject != null) { Destroy(bet.gameObject); } } Bets.Clear(); CurGameType = PlayerGameType.None; WinEffect.SetActive(false); GameType.gameObject.SetActive(false); RefreshPanel(); BetLabel.gameObject.SetActive(false); UserBetPoker.Reset(); SetPlayerReadyState(false); }
/// <summary> /// 玩家下注 /// </summary> public void PlayerBet(int money, bool changeRoomG = true) { if (Info == null) { YxDebug.LogError("没有用户信息!!"); return; } if (money <= 0) { return; } BetMoney += money; GameObject[] bets = App.GetGameManager <GangWuGameManager>().BetMgr.CreatBetArray(money, 4, transform); for (int i = 0; i < bets.Length; i++) { Bet bet = bets[i].GetComponent <Bet>(); bet.BeginMove(bet.transform.localPosition, BetLabel.transform.localPosition, i * App.GetGameData <GangwuGameData>().BetSpeace, BetFinishedType.Hide, () => { BetLabel.gameObject.SetActive(true); }); Bets.Add(bet); } BetLabel.text = YxUtiles.ReduceNumber(BetMoney);//App.GetGameData<GlobalData>().GetShowGold(BetMoney); Facade.Instance <MusicManager>().Play("bet"); if (changeRoomG) { Coin -= money; } if (Coin <= 0) { Facade.Instance <MusicManager>().Play("allin"); CurGameType = PlayerGameType.AllIn; } RefreshPanel(); }
/// <summary> /// 通过名字显示玩家状态 /// </summary> /// <param name="type">当前玩家状态,对应游戏状态</param> public void ShowGameType(PlayerGameType type) { switch (type) { case PlayerGameType.AddBet: PlayerType = 1; ShowTypeSprite("AddBet"); //PlaySound("bet"); //只有一个,不用随机 break; case PlayerGameType.Call: PlayerType = 2; ShowTypeSprite("Call"); //PlaySound("call"); //跟注 break; case PlayerGameType.Fold: PlayerType = 3; ShowTypeSprite("Fold"); break; case PlayerGameType.KaiPai: PlayerType = 8; ShowTypeSprite("KaiPai"); //PlaySound("kaiPai"); break; case PlayerGameType.QiLi: PlayerType = 9; ShowTypeSprite("QiLi"); //PlaySound("qili"); break; default: HideGameType(); break; } }