public void SetDissData(ArgsMsgGameOverMsg args) { bool IsWin = false; //打二 if (RoomInfo.Instance.IsZhuandanGameType || RoomInfo.Instance.IsGuandan2GameType) { } else //非打二 { var list = args.mGameOverList; GameObject totalPrefabItem = ResourceManager.Instance.LoadAsset <GameObject>(UIType.TotalBureauOverItem.Path); bool isTie = PlayerInfo.Instance.mTeamEnemyIndex == PlayerInfo.Instance.mTeamSelfIndex;//平局 for (int i = 0; i < list.Count; i++) { GameObject item = GameObject.Instantiate(totalPrefabItem); item.transform.SetParent(itemParent); //item.transform.localPosition = new Vector3(0, 60 - 55 * i, 0); item.transform.localScale = Vector3.one; item.transform.localPosition = Vector3.zero; EPlayersTeam team = (EPlayersTeam)RoomInfo.Instance.GetPlayerInfoById(list[i].player_id).teamType; if (winTeam == EPlayersTeam.ENull) { winTeam = list[i].rank == MsgGuandanGameRank.MsgGuandanGameRankFirst ? team : EPlayersTeam.ENull; } item.GetComponent <UITotalBureauOverItem>().SetData(list[i], winTeam); if (list[i].player_id == PlayerInfo.Instance.mPlayerPid) { IsWin = team == winTeam; } } } }
//掼蛋 public void SetData(MsgGameOverInfo msgGameOverInfo, EPlayersTeam winTeam) { ulong playerId = msgGameOverInfo.player_id; var data = RoomInfo.Instance.GetPlayerInfoById(playerId); string forBgName = playerId == PlayerInfo.Instance.mPlayerPid ? "record_list_self" : "record_list"; foreBg.sprite = ResourceManager.Instance.GetSpriteByName((int)EAtlasType.EPlaying, forBgName); creater.enabled = RoomInfo.Instance.mRoom.creater_id == playerId ? true : false; nameLab.text = data.name + string.Format("\nID:{0}", playerId);//玩家的名字 jfOrDadao.text = data.teamType == (int)winTeam ? "打过:" : "打到:"; bool isEnd = RoomInfo.Instance.mNextIndex != RoomInfo.Instance.GetEndgradOfTGuanDanGameType(); if (PlayerInfo.Instance.mTeamEnemyIndex == PlayerInfo.Instance.mTeamSelfIndex || isEnd) { jfOrDadao.text = "打到:"; } if (playerId != PlayerInfo.Instance.mPlayerPid) { StartCoroutine(GlobalData.GetHeadTextureByIdx(headTex, data.head_portrait)); } else { headTex.texture = DataManager.Instance.GetTextureByName(ETextureName.EHeadTex1); } scoreLab.text = GlobalData.StringUpgradeIndex(msgGameOverInfo.upgrade_card.ToString()); }
public void SetItems(List <MsgGameOverInfo> list, bool totalOver) { uint nextPlayCommonCardId = GetNextCommonCard(list); isTotalOver = totalOver; //RefreshViewInfo(nextPlayCommonCardId); bureauPrefabItem = ResourceManager.Instance.LoadAsset <GameObject>(UIType.BureauOverItem.Path); int overGoal = 0; for (int i = 0; i < list.Count; i++) { GameObject item = GameObject.Instantiate(bureauPrefabItem); item.transform.SetParent(parentContainer); RawImage tex = parentContainer.GetComponent <RawImage>(); item.transform.localPosition = new Vector3(0, -30 - 140 * i, 0); item.transform.localScale = Vector3.one; if (winTeam == EPlayersTeam.ENull) { winTeam = list[i].rank == MsgGuandanGameRank.MsgGuandanGameRankFirst ? (EPlayersTeam)RoomInfo.Instance.GetPlayerInfoById(list[i].player_id).teamType : EPlayersTeam.ENull; } item.GetComponent <UIBureauOverItem>().SetData(list[i], winTeam); //if (list[i].player_id == PlayerInfo.Instance.mPlayerPid) //{ // overGoal = (int)list[i].goal; // lightSpr.spriteName = overGoal > 0 ? "settlement_light1" : "settlement_light4"; //} isOver = list[0].over == 1; Debug.Log("Over:" + list[i].over); } CheckPlayAudio(overGoal); }
IEnumerator LoadGameBureauOver(LocalNotification e) { yield return(new WaitForSeconds(GlobalData.mLoadGameBreauOverWaitTime)); ArgsMsgGameOverMsg msg = e.param as ArgsMsgGameOverMsg; if (msg != null) { bool isOver = false; #region 局打几 和加载总结算还是小结算 //当前玩家的队 EPlayersTeam mTeamtype = (EPlayersTeam)RoomInfo.Instance.GetPlayerInfoById(PlayerInfo.Instance.mPlayerPid).teamType; bool isGuandanNotTwo = !RoomInfo.Instance.IsZhuandanGameType && !RoomInfo.Instance.IsGuandan2GameType; //是否是掼蛋非打二 //组别是为了结算显示的打到几的 颜色相同 for (int i = 0; i < msg.mGameOverList.Count; i++) { //当前id判断是否是己方 ulong pid = msg.mGameOverList[i].player_id; var nowPlayerInfo = RoomInfo.Instance.GetPlayerInfoById(pid); EPlayersTeam pt = (EPlayersTeam)nowPlayerInfo.teamType; if (isGuandanNotTwo) { //头游 if (pid == PlayerInfo.Instance.mPlayerPid) //是当前的玩家id { PlayerInfo.Instance.mTeamSelfIndex = msg.mGameOverList[i].upgrade_card.ToString(); //己方打几 } else if (pt != mTeamtype) { PlayerInfo.Instance.mTeamEnemyIndex = msg.mGameOverList[i].upgrade_card.ToString();//对方打几 } if (msg.mGameOverList[i].rank == MsgGuandanGameRank.MsgGuandanGameRankFirst)//头游打几 决定下一局打几 { RoomInfo.Instance.mNextIndex = msg.mGameOverList[i].upgrade_card.ToString(); } } isOver = msg.mGameOverList[i].over == 1; } #endregion //—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— if (isOver && isGuandanNotTwo)//掼蛋的情况 { Debug.Log("加载掼蛋非打二总结算"); UpdateTotalBureauOverGame(e); } else { Debug.Log("加载打二情况小结算"); ContextManager.Instance.Push(new BureauOverContext()); GameObject gameBureau = UIManagers.Instance.GetSingleUI(UIType.BureauOverView); gameBureau.GetComponent <UIBureauOverView>().SetItems(msg.mGameOverList, msg.mIsTotalOver); } } SelfCardsManager.Instance.ClearInfo(); PlayingGameInfo.Instance.ClearCurGameInfo(); }
public void SetData(MsgGameOverInfo msg, EPlayersTeam winTeam) { this.awardNumSpr.sprite = GlobalData.GetGameCleanCpr((int)msg.rank); string forbgName = msg.player_id == PlayerInfo.Instance.mPlayerPid ? "record_list_self" : "record_list"; foreBg.sprite = ResourceManager.Instance.GetSpriteByName((int)EAtlasType.EMain, forbgName); awardNumSpr.sprite = GlobalData.GetGameCleanCpr((int)msg.rank); awardNumSpr.gameObject.SetActive(awardNumSpr.sprite != null); var data = RoomInfo.Instance.GetPlayerInfoById(msg.player_id); chaperSpr.gameObject.SetActive(msg.player_id == RoomInfo.Instance.mRoom.creater_id); if (msg.player_id != PlayerInfo.Instance.mPlayerPid) { StartCoroutine(GlobalData.GetHeadTextureByIdx(headTexture, data.head_portrait)); } else { headTexture.texture = DataManager.Instance.GetTextureByName(ETextureName.EHeadTex1); } awardNumSpr.SetNativeSize(); var player = RoomInfo.Instance.GetPlayerInfoById(msg.player_id); nameAndId.text = player.name + "\n" + "ID:" + msg.player_id; if (RoomInfo.Instance.IsZhuandanGameType || RoomInfo.Instance.IsGuandan2GameType) { jiFengOrDadao.text = "积分:"; //scorelab.color = (int)msg.goal >= 0 ? Color.yellow : Color.gray; int goal = (int)msg.goal; this.scorelab.text = goal > 0 ? "+" + goal : goal.ToString(); } else //含金币场结算 { jiFengOrDadao.text = "打到:"; this.scorelab.text = GlobalData.StringUpgradeIndex(msg.upgrade_card.ToString()); bool isGold = GoldFiledManager.Instance.mIsGoldFiled; UpdateGoldModeData((int)msg.goal, PlayerInfo.Instance.mPlayerPid == msg.player_id); } }
public void SetData(LocalNotification e) { if (itemParent.childCount == 4) { return; } //屏蔽之后传过来的消息 bool IsWin = false; //打二 if (RoomInfo.Instance.IsZhuandanGameType || RoomInfo.Instance.IsGuandan2GameType) { ArgsMsgTotalScore args = e.param as ArgsMsgTotalScore; var list = args.List; Debug.Log("TotalBureauView:" + args.List.Count); GameObject totalPrefabItem = ResourceManager.Instance.LoadAsset <GameObject>(UIType.TotalBureauOverItem.Path); for (int i = 0; i < list.Count; i++) { GameObject item = GameObject.Instantiate(totalPrefabItem); item.transform.SetParent(itemParent); //item.transform.localPosition = new Vector3(0, 225 - 130 * i, 0); item.transform.localScale = Vector3.one; item.transform.localPosition = Vector3.zero; item.GetComponent <UITotalBureauOverItem>().SetData(list[i].player_id, list[i].play_goal); if (list[i].player_id == PlayerInfo.Instance.mPlayerPid) { //图片的显示,和输赢有关系 IsWin = list[i].play_goal >= 0; } } } else //非打二 { ArgsMsgGameOverMsg args = e.param as ArgsMsgGameOverMsg; var list = args.mGameOverList; bool isTie = PlayerInfo.Instance.mTeamEnemyIndex == PlayerInfo.Instance.mTeamSelfIndex;//平局 GameObject totalPrefabItem = ResourceManager.Instance.LoadAsset <GameObject>(UIType.TotalBureauOverItem.Path); for (int i = 0; i < list.Count; i++) { GameObject item = GameObject.Instantiate(totalPrefabItem); item.transform.SetParent(itemParent); //item.transform.localPosition = new Vector3(0, 225 - 130 * i, 0); item.transform.localScale = Vector3.one; item.transform.localPosition = Vector3.zero; EPlayersTeam team = (EPlayersTeam)RoomInfo.Instance.GetPlayerInfoById(list[i].player_id).teamType; if (winTeam == EPlayersTeam.ENull) { winTeam = list[i].rank == MsgGuandanGameRank.MsgGuandanGameRankFirst ? team : EPlayersTeam.ENull; } if (isTie) { winTeam = team; } item.GetComponent <UITotalBureauOverItem>().SetData(list[i], winTeam); if (list[i].player_id == PlayerInfo.Instance.mPlayerPid) { IsWin = team == winTeam;//平局 } if (isTie) { IsWin = true; } } } CheckPlayerAudio(IsWin); }