public void SetData() { for (int i = 0; i < 4; i++) { PlayerList[i].SetActive(false); } for (int i = 0; i < PartGameOverControl.instance.SettleInfoList.Count; i++) { PartGameOverControl.instance.SettleInfoList[i].LeftCardList = CardTools.CardValueSort(PartGameOverControl.instance.SettleInfoList[i].LeftCardList); PlayerList[i].SetActive(true); PlayerList[i].transform.GetComponent <UILabel>().text = GameDataFunc.GetPlayerInfo((byte)PartGameOverControl.instance.SettleInfoList[i].Pos).name.ToString(); PosAndCardList[PartGameOverControl.instance.SettleInfoList[i].Pos] = new List <GameObject>(); int count = PosAndCardList[PartGameOverControl.instance.SettleInfoList[i].Pos].Count; for (int j = 0; j < count; j++) { Destroy(PosAndCardList[PartGameOverControl.instance.SettleInfoList[i].Pos][j]); } PosAndCardList[PartGameOverControl.instance.SettleInfoList[i].Pos] = new List <GameObject>(); for (int j = 0; j < PartGameOverControl.instance.SettleInfoList[i].LeftCardList.Count; j++) { GameObject g = GameObject.Instantiate(CardObj, PlayerList[i].transform.Find("CardPoint")); g.transform.localScale = new Vector3(0.6f, 0.6f, 0.4f); g.transform.localPosition = new Vector3(j * 25, 0, 0); g.SetActive(true); g.transform.GetComponent <Card>().SetValue(PartGameOverControl.instance.SettleInfoList[i].LeftCardList[j]); PosAndCardList[PartGameOverControl.instance.SettleInfoList[i].Pos].Add(g); } } }
// Use this for initialization void OnEnable() { PlayerInfo info = GameDataFunc.GetPlayerInfo(Player.Instance.guid); for (int i = 0; i < CardList.Count; i++) { CardList[i].transform.localPosition = new Vector3(0, -820, 0); CardList[i].transform.localRotation = Quaternion.EulerAngles(0, 0, 0); } for (int i = 0; i < info.localCardList.Count; i++) { CardList[i].spriteName = info.localCardList[i].ToString(); } MoveUpAnim(); StartCoroutine(RotateAnim()); // RotateAnim(); }
public void Init() { if (GameData.GlobleRoomType != FrameworkForCSharp.Utils.RoomType.NN)//麻将 四人局及以下 { ItemArray[0].transform.parent.gameObject.SetActive(true); ItemArrayTwo[0].transform.parent.gameObject.SetActive(false); for (int i = 0; i < GameData.m_PlayerInfoList.Count; i++) { PlayerInfo info = GameData.m_PlayerInfoList[i]; GameObject obj = ItemArray[info.pos - 1]; obj.SetActive(true); obj.transform.Find("name").GetComponent <UILabel>().text = info.name; obj.transform.Find("state").gameObject.SetActive(IsAgreeList(info.pos)); DownloadImage.Instance.Download(obj.transform.Find("headImage").GetComponent <UITexture>(), info.headID); } if (IsAgreeList(GameDataFunc.GetPlayerInfo(Player.Instance.guid).pos)) { HideBtn(); } } else { for (int i = 0; i < ItemArrayTwo.Length; i++) { ItemArrayTwo[i].gameObject.SetActive(false); } ItemArray[0].transform.parent.gameObject.SetActive(false); ItemArrayTwo[0].transform.parent.gameObject.SetActive(true); for (int i = 0; i < GameData.m_PlayerInfoList.Count; i++) { PlayerInfo info = GameData.m_PlayerInfoList[i]; GameObject obj = ItemArrayTwo[info.pos - 1]; obj.SetActive(true); obj.transform.Find("name").GetComponent <UILabel>().text = info.name; obj.transform.Find("state").gameObject.SetActive(IsAgreeList(info.pos)); DownloadImage.Instance.Download(obj.transform.Find("headImage").GetComponent <UITexture>(), info.headID); } if (IsAgreeList(GameDataFunc.GetPlayerInfo(Player.Instance.guid).pos)) { HideBtn(); } } }
/// <summary> /// 设置值 /// </summary> public void SetInfo() { for (var i = 0; i < PartGameOverControl.instance.SettleInfoList.Count; i++) { ItemList[i].SetActive(true); if (PartGameOverControl.instance.SettleInfoList[i].ChangeScore > 0) { ItemList[i].transform.Find("LabScore").GetComponent <UILabel>().text = "+" + PartGameOverControl.instance.SettleInfoList[i].ChangeScore; } else { ItemList[i].transform.Find("LabScore").GetComponent <UILabel>().text = PartGameOverControl .instance.SettleInfoList[i].ChangeScore.ToString(); } ItemList[i].transform.Find("Name").GetComponent <UILabel>().text = GameDataFunc .GetPlayerInfo((byte)PartGameOverControl.instance.SettleInfoList[i].Pos).name; DownloadImage.Instance.Download(ItemList[i].transform.Find("HeadSprite").GetComponent <UITexture>(), GameDataFunc.GetPlayerInfo((byte)PartGameOverControl.instance.SettleInfoList[i].Pos).headID); } }
// int[] baseScoreArray = new int[] { 1, 1, 3, 5, 10 }; // string[] baseString = new string[] {"缺门", "缺一", "缺三", "缺五", "缺十", }; // Use this for initialization void Start() { if (GameData.m_TableInfo.IsPiPei) { QuiteBtn.gameObject.SetActive(true); ChangeTable.gameObject.SetActive(true); btnShare.SetActive(false); } else { QuiteBtn.gameObject.SetActive(false); ChangeTable.gameObject.SetActive(false); btnShare.SetActive(true); } UIEventListener.Get(QuiteBtn.gameObject).onClick = OnClick; UIEventListener.Get(btnShare).onClick = OnClick; UIEventListener.Get(btnRight).onClick = OnClick; UIEventListener.Get(ChangeTable.gameObject).onClick = OnClick; // GameDataFunc.GetPlayerInfo //ImgType.spriteName = GameDataFunc.GetPlayerInfo(Player.Instance.guid).changeScore >= 0? "UI_GameResult_icon_win" : "UI_GameResult_icon_lose"; if (GameData.m_RoundOverInfo.isHuPai)//有人胡牌 { ImgType.spriteName = GameDataFunc.GetPlayerInfo(Player.Instance.guid).huType != HuType.None ? "UI_GameResult_icon_win" : "UI_GameResult_icon_lose"; } else//流局 { ImgType.spriteName = "UI_GameResult_icon_draw"; } if (GameDataFunc.GetPlayerInfo(Player.Instance.guid).huType != HuType.None)//胡牌了 { SoundManager.Instance.PlaySound(UIPaths.GAMEWIN); } else { SoundManager.Instance.PlaySound(UIPaths.GAMELOSE); } if (GameData.m_IsNormalOver) { btnRight.GetComponent <UISprite>().spriteName = "UI_GameResult_btn_RoomResult"; } for (int i = 0; i < GameData.m_PlayerInfoList.Count; i++) { PlayerInfo info = GameData.m_PlayerInfoList[i]; GameObject obj = ItemArray[info.pos - 1]; obj.SetActive(true); obj.transform.Find("name").GetComponent <UILabel>().text = info.name; if (!GameData.m_TableInfo.IsPiPei) { obj.transform.Find("score").GetComponent <UILabel>().text = info.changeScore.ToString(); } else { obj.transform.Find("score").GetComponent <UILabel>().text = info.changeScore.ToString(); // obj.transform.Find("score").GetComponent<UILabel>().text = (info.changeScore * JinBiDataControl.Instance.TaoSHangRate).ToString(); } DownloadImage.Instance.Download(obj.transform.Find("headImage").GetComponent <UITexture>(), info.headID); obj.transform.Find("ZhuangSprite").gameObject.SetActive(false); if (info.pos == GameData.m_TableInfo.ZhuangPos) { obj.transform.Find("ZhuangSprite").gameObject.SetActive(true); } if (GameData.GlobleRoomType == RoomType.WDH) { #region wdh if (info.huType != HuType.None) { obj.transform.Find("rightTxt").GetComponent <UILabel>().text = ""; obj.transform.Find("leftTxt").GetComponent <UILabel>().text = ""; // None = 0, //QiDui = 1, //Bao_GangKai = 2, //QiXing = 3, //Bao_QiXing = 4, //PengPengHu = 5, //Bao_PengPengHu = 6 if (info.prizeType == PrizeType.TianHu) { obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "X2\n";// "七对\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "天胡\n"; } if (info.prizeType == PrizeType.Bao_TianHu) { obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "X1\n";// "七对\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "天胡当宝\n"; } if (info.prizeType == PrizeType.QiDui) { obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "X4\n";// "七对\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "七对\n"; } else if (info.prizeType == PrizeType.PengPengHu) { obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "X2\n";// "碰碰胡不当宝\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "碰碰胡不当宝\n"; } else if (info.prizeType == PrizeType.Bao_PengPengHu) { obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "X1\n";// "碰碰胡不当宝\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "碰碰胡当宝\n"; } else if (info.prizeType == PrizeType.QiXing) { obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "X2\n";// "七星\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "七星不当宝\n"; } else if (info.prizeType == PrizeType.Bao_QiXing) { obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "X1\n";// "七星\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "七星当宝\n"; } if (info.prizeType == PrizeType.DanDiao) { obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "X4\n";// "七星\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "单吊不当宝\n"; } if (info.prizeType == PrizeType.Bao_DanDiao) { obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "X2\n";// "七星\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "单吊当宝\n"; } if (info.prizeType == PrizeType.Bao_GangKai) { obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "X1\n";// "七星\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "杠开当宝\n"; } if (info.GangKaiCount > 0 && info.prizeType != PrizeType.Bao_GangKai) { obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "X2\n";// "杠开不当宝\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "杠开不当宝\n"; } if (info.GangKaiCount > 1) { switch (info.GangKaiCount) { case 1: obj.transform.Find("rightTxt").Find("LiangxuGang").GetComponent <UILabel>().text = "X1"; break; case 2: obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "X2\n"; // "连续杠开\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "连续杠开\n"; break; case 3: obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "X4\n"; // "连续杠开\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "连续杠开\n"; break; case 4: obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "X4\n"; // "连续杠开\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "连续杠开\n"; break; } } if (GameData.m_TableInfo.IsJIangMa) { obj.transform.Find("rightTxt").GetComponent <UILabel>().text += info.TaoShangScore.ToString() + "\n";// "奖码\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "奖码\n"; } } else if (info.huType == HuType.None) { obj.transform.Find("rightTxt").GetComponent <UILabel>().text = ""; obj.transform.Find("leftTxt").GetComponent <UILabel>().text = ""; } #endregion } else if (GameData.GlobleRoomType == RoomType.ZB) { #region zb obj.transform.Find("rightTxt").GetComponent <UILabel>().text = ""; obj.transform.Find("leftTxt").GetComponent <UILabel>().text = ""; if (info.huType != HuType.None) { switch (info.huType) { case HuType.QiDuiHu: obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "3分\n"; // "七对\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "七对\n"; break; case HuType.ShiSiBuDa: obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "3分\n"; // "七对\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "十四不搭\n"; break; case HuType.YaoJiuPai: obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "3分\n"; // "七对\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "幺九牌\n"; break; case HuType.Normal: obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "2分\n"; // "七对\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "普通胡\n"; break; } if (!GameData.m_RoundOverInfo.IsUseMagicCard) { obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "1分\n";// obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "无挡\n"; } if (GameData.m_RoundOverInfo.MianCount > 0 || GameData.m_RoundOverInfo.GangCount > 0) { obj.transform.Find("rightTxt").GetComponent <UILabel>().text += (GameData.m_RoundOverInfo.GangCount + GameData.m_RoundOverInfo.MianCount).ToString() + "分\n";// "七对\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "吃面X" + (GameData.m_RoundOverInfo.GangCount + GameData.m_RoundOverInfo.MianCount).ToString() + "\n"; } switch ((int)GameData.m_RoundOverInfo.ZaiBaoCount) { case 1: obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "10分\n"; // "七对\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "栽宝X" + GameData.m_RoundOverInfo.ZaiBaoCount.ToString() + "\n"; break; case 2: obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "30分\n"; // "七对\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "栽宝X" + GameData.m_RoundOverInfo.ZaiBaoCount.ToString() + "\n"; break; case 3: obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "50分\n"; // "七对\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "栽宝X" + GameData.m_RoundOverInfo.ZaiBaoCount.ToString() + "\n"; break; case 4: obj.transform.Find("rightTxt").GetComponent <UILabel>().text += "70分\n"; // "七对\n"; obj.transform.Find("leftTxt").GetComponent <UILabel>().text += "栽宝X" + GameData.m_RoundOverInfo.ZaiBaoCount.ToString() + "\n"; break; } } #endregion } #region //string leftTxt = "跑分"; //string rightTxt = info.fangPaoScore.ToString(); //if(info.menCount < 3) //{ // leftTxt += "\n"+baseString[(int)info.huType]; // rightTxt += "\n*" + baseScoreArray[(int)info.huType]; // if (info.pos == GameData.m_RoundOverInfo.huPos && GameData.m_RoundOverInfo.isHuPai) // { // if (GameData.m_RoundOverInfo.isDianPaoHu || GameData.m_RoundOverInfo.isQiangGuangHu) // { // leftTxt += "\n点炮"; // rightTxt += "\n*1"; // } // else // { // leftTxt += "\n自摸"; // rightTxt += "\n*4"; // } // } // int mingGangCount = 0; // int anGangCount = 0; // for (int k = 0; k < info.operateCardList.Count; k++) // { // if (info.operateCardList[k].opType == CatchType.AnGang) // { // anGangCount++; // } // else if (info.operateCardList[k].opType == CatchType.Gang || info.operateCardList[k].opType == CatchType.BuGang) // { // mingGangCount++; // } // } // if (anGangCount > 0) // { // leftTxt += "\n暗杠*" + anGangCount; // int baseScore = baseScoreArray[(int)info.huType]; // int totalScore = 0; // for (int k = 0; k < GameData.m_PlayerInfoList.Count; k++) // { // if (GameData.m_PlayerInfoList[k].pos == info.pos) continue; // int tempScore = (int)(info.fangPaoScore + GameData.m_PlayerInfoList[k].fangPaoScore); // totalScore += (tempScore +1) * 4*anGangCount*baseScore; // } // rightTxt += "\n+" + totalScore; // } // if (mingGangCount > 0) // { // leftTxt += "\n明杠*" + mingGangCount; // int baseScore = baseScoreArray[(int)info.huType]; // int totalScore = 0; // for (int k = 0; k < GameData.m_PlayerInfoList.Count; k++) // { // if (GameData.m_PlayerInfoList[k].pos == info.pos) continue; // int tempScore = (int)(info.fangPaoScore + GameData.m_PlayerInfoList[k].fangPaoScore); // totalScore += (tempScore+1) * mingGangCount*baseScore; // } // rightTxt += "\n+" + totalScore; // } //} //obj.transform.Find("leftTxt").GetComponent<UILabel>().text = leftTxt; //obj.transform.Find("rightTxt").GetComponent<UILabel>().text = rightTxt; #endregion } ItemArray[0].transform.parent.GetComponent <UIGrid>().enabled = true; TranMyFrame.parent = ItemArray[GameDataFunc.GetPlayerInfo(Player.Instance.guid).pos - 1].transform; TranMyFrame.localPosition = Vector3.zero; GameDataReset(); }
public void EnsureJiangMa() { EffectNum = new List <int>(); for (int i = 1; i < 5; i++) { PlayerInfo info = GameDataFunc.GetPlayerInfo((byte)i); if (info.huType != FrameworkForCSharp.Utils.HuType.None) { HuPos = i; } } switch ((int)GameData.m_TableInfo.ZhuangPos) { case 1: switch (HuPos) { case 1: EffectNum.Add(1); EffectNum.Add(5); EffectNum.Add(9); break; case 2: EffectNum.Add(2); EffectNum.Add(6); break; case 3: EffectNum.Add(3); EffectNum.Add(7); break; case 4: EffectNum.Add(4); EffectNum.Add(8); break; } break; case 2: switch (HuPos) { case 1: EffectNum.Add(4); EffectNum.Add(8); break; case 2: EffectNum.Add(1); EffectNum.Add(5); EffectNum.Add(9); break; case 3: EffectNum.Add(2); EffectNum.Add(6); break; case 4: EffectNum.Add(3); EffectNum.Add(7); break; } break; case 3: switch (HuPos) { case 1: EffectNum.Add(3); EffectNum.Add(7); break; case 2: EffectNum.Add(4); EffectNum.Add(8); break; case 3: EffectNum.Add(1); EffectNum.Add(5); EffectNum.Add(9); break; case 4: EffectNum.Add(2); EffectNum.Add(6); break; } break; case 4: switch (HuPos) { case 1: EffectNum.Add(2); EffectNum.Add(6); break; case 2: EffectNum.Add(3); EffectNum.Add(7); break; case 3: EffectNum.Add(4); EffectNum.Add(8); break; case 4: EffectNum.Add(1); EffectNum.Add(5); EffectNum.Add(9); break; } break; } }
/// <summary> /// 设置值 /// </summary> public void SetInfo() { for (int i = 0; i < PartGameOverControl.instance.TotalGameOverInfoList.Count; i++) { ItemList[i].transform.Find("PlayerNameLabel").GetComponent <UILabel>().text = GameDataFunc.GetPlayerInfo((byte)PartGameOverControl.instance.TotalGameOverInfoList[i].pos).name.ToString(); ItemList[i].transform.Find("ChangeScoreLabel").GetComponent <UILabel>().text = (PartGameOverControl.instance.TotalGameOverInfoList[i].score).ToString(); ItemList[i].SetActive(true); DownloadImage.Instance.Download(ItemList[i].transform.Find("HeadSprite").GetComponent <UITexture>(), GameDataFunc.GetPlayerInfo((byte)PartGameOverControl.instance.TotalGameOverInfoList[i].pos).headID); } }
/// <summary> /// 设置值 /// </summary> public void SetInfo() { for (var i = 0; i < PartGameOverControl.instance.TotalGameOverInfoList.Count; i++) { ItemList[i].gameObject.SetActive(true); ItemList[i].transform.Find("PlayerNameLabel").GetComponent <UILabel>().text = GameDataFunc .GetPlayerInfo(PartGameOverControl.instance.TotalGameOverInfoList[i].pos).name; ItemList[i].transform.Find("ChangeScoreLabel").GetComponent <UILabel>().text = PartGameOverControl.instance.TotalGameOverInfoList[i].score.ToString(); DownloadImage.Instance.Download(ItemList[i].transform.Find("HeadSprite").GetComponent <UITexture>(), GameDataFunc.GetPlayerInfo(PartGameOverControl.instance.TotalGameOverInfoList[i].pos).headID); } //设置单局数据 for (var i = 0; i < PartGameOverControl.instance.ListGameOverSmall.Count; i++) { GameObject go; if (i < ListItemOnceHistory.Count) { go = ListItemOnceHistory[i]; } else { go = Instantiate(ItemOnceHistory, ItemOnceHistoryBase, false); ListItemOnceHistory.Add(go); } go.SetActive(true); go.transform.Find("LabJuShu").GetComponent <UILabel>().text = "第" + (i + 1) + "局"; var tPlayer = go.transform.Find("Player"); for (var j = 0; j < tPlayer.childCount; j++) { if (j < PartGameOverControl.instance.ListGameOverSmall[i].Count) { tPlayer.GetChild(j).gameObject.SetActive(true); tPlayer.GetChild(j).Find("LabName").GetComponent <UILabel>().text = GameDataFunc .GetPlayerInfo((byte)PartGameOverControl.instance.ListGameOverSmall[i][j].Pos).name; var score = PartGameOverControl.instance.ListGameOverSmall[i][j].ChangeScore; var labScore = tPlayer.GetChild(j).Find("LabScore").GetComponent <UILabel>(); if (score > 0) { labScore.text = "+" + score; } else { labScore.text = score.ToString(); } } else { tPlayer.GetChild(j).gameObject.SetActive(false); } } var data = PartGameOverControl.instance.ListGameOverSmall[i]; go.transform.Find("BtnLook").GetComponent <UIButton>().onClick.Add(new EventDelegate(delegate { PartGameOverControl.instance.SettleInfoList = data; UIManager.Instance.ShowUiPanel(UIPaths.PanelGameOverSmall); })); } }