public void GetHistoryInfo(List <UserMatchInfo> matchInfos) { var gdata = App.GetGameData <SssGameData>(); HistoryItemInfo historyInfo = new HistoryItemInfo { Users = new List <HistoryUserInfo>(), RoundVal = gdata.CurRound, }; int bankerSeat = gdata.BankerSeat; foreach (UserMatchInfo info in matchInfos) { SssPlayer user = gdata.GetPlayer <SssPlayer>(info.Seat, true); if (user.Info == null) { continue; } HistoryUserInfo userInfo = new HistoryUserInfo { SssUserInfo = user.GetInfo <SssUserInfo>(), Seat = user.Info.Seat, Pokers = info.Cards.ToArray(), AddScore = info.AddScore.ToArray(), NormalScore = info.NormalScores.ToArray(), Score = info.TtScore, DunType = info.DunTypeList.ToArray(), Sprcial = info.Special, ShootInfo = info.Shoot, IsBanker = gdata.IsBankerModel && bankerSeat == user.Info.Seat }; historyInfo.Users.Add(userInfo); } SetGetShootTime(historyInfo.Users); HistoryList.Add(historyInfo); if (MaxCount == 0) //如果是0,则不限制个数 { return; } while (HistoryList.Count > MaxCount) { HistoryList.Remove(HistoryList[0]); } }
IEnumerator DoFaPai(int[] seats) { var gdata = App.GetGameData <SssGameData>(); int seatsLength = seats.Length; int pokerCount = seatsLength * 13; while (_pokerCounter < pokerCount && _dealing) { foreach (int seat in seats) { GameObject poker = GetPoker(_pokerCounter + 1); SssPlayer user = gdata.GetPlayer <SssPlayer>(seat, true); user.ReadyState = true; //由于有自动准备,这里直接设置成true Facade.Instance <MusicManager>().Play("sendcard"); user.UserCardList.Add(poker); poker.transform.parent = user.PokerParent; poker.transform.localScale = Vector3.one * Scale; MoveCard(poker, poker.transform.localPosition, user.GetTargetPos()); RotateCard(poker, new Vector3(0, 0, -70), Vector3.zero); AlphaCard(poker, 0, 1); } yield return(new WaitForSeconds(SpaceTime)); } //刷新一次扑克的父层级,保证扑克的正确渲染 for (int i = 0; i < seats.Length; i++) { Transform parent = gdata.GetPlayer <SssPlayer>(i).PokerParent; parent.gameObject.SetActive(false); parent.gameObject.SetActive(true); } //扑克飞到手中再展开 yield return(new WaitForSeconds(0.3f)); foreach (int seat in seats) { SssPlayer user = gdata.GetPlayer <SssPlayer>(seat, true); user.Waitting(); if (user.FinishChoise) { user.MoveHandCardWithAnim(); } } _dealing = false; }
/// <summary> /// 为一个玩家创建13张牌,无过程 /// </summary> public void FaPai(SssPlayer user) { int userCardsCount = user.UserCardList.Count; //如果玩家手牌够13张,则不需要发牌 if (userCardsCount >= 13) { return; } int diff = 13 - userCardsCount; _dealing = false; StopAllCoroutines(); for (int i = 0; i < diff; i++) //每人补全发牌 { GameObject poker = GetPoker((userCardsCount + i + 1) * 2); user.UserCardList.Add(poker); } }
public void ResultFlyChips(ISFSObject data) { var gdata = App.GetGameData <SssGameData>(); ISFSArray resultArray = data.GetSFSArray("score"); foreach (ISFSObject result in resultArray) { int seat = result.GetInt("seat"); //显示玩家输赢的分数 int score = result.GetInt("score"); SssPlayer resultPanel = gdata.GetPlayer <SssPlayer>(seat, true); resultPanel.ShowResultLabel(score); if (result.ContainsKey("gold")) { resultPanel.Coin = result.GetLong("gold"); } if (score == 0) { continue; } if (score > 0) { WinSeats.Add(seat); } else { LoseSeats.Add(seat); } } DoResult(); }
public void ShootSomeone(SssPlayer someone) { ShootAnim.transform.localEulerAngles = GetAngleOfAim(someone.Holes); ShootAnim.DoShoot(someone); }
public void Reset() { gameObject.SetActive(false); _targetUser = null; OnFinish = null; }
public void DoShoot(SssPlayer someone) { _targetUser = someone; gameObject.SetActive(true); }