private void analysisPaiInfo(HupaiResponseItem parms) { var itemData = parms.totalInfo; string gangpaiStr = itemData.gang; if (gangpaiStr != null && gangpaiStr.Length > 0) { string[] gangtemps = gangpaiStr.Split(','); for (int i = 0; i < gangtemps.Length; i++) { var itemList = gangtemps[i].Split(':'); GangpaiObj gangpaiObj = new GangpaiObj(); gangpaiObj.uuid = int.Parse(itemList[0]); gangpaiObj.cardPiont = int.Parse(itemList[1]); gangpaiObj.type = itemList[2]; //增加判断是否为自己的杠牌的操作 paiArray [gangpaiObj.cardPiont] -= 4; gangPaiList.Add(gangpaiObj); if (gangpaiObj.type == "an") { mdesCribe += "暗杠 "; } else { mdesCribe += "明杠 "; } } } string pengpaiStr = itemData.peng; if (pengpaiStr != null && pengpaiStr.Length > 0) { pengpaiList = pengpaiStr.Split(','); //string[] pengpaiListTTT = pengpaiList; List <string> pengpaiListTTT = new List <string>(); for (int i = 0; i < pengpaiList.Length; i++) { if (paiArray [int.Parse(pengpaiList [i])] >= 3) { paiArray [int.Parse(pengpaiList [i])] -= 3; pengpaiListTTT.Add(pengpaiList [i]); } } pengpaiList = pengpaiListTTT.ToArray(); } string chipaiStr = itemData.chi; if (chipaiStr != null && chipaiStr.Length > 0) { string[] chitemps = chipaiStr.Split(','); for (int i = 0; i < chitemps.Length; i++) { string item = chitemps[i]; ChipaiObj chipaiObj = new ChipaiObj(); string[] pointStr = item.Split(':'); chipaiObj.cardPionts = pointStr; chipaiList.Add(chipaiObj); paiArray [int.Parse(chipaiObj.cardPionts[0])] -= 1; paiArray [int.Parse(chipaiObj.cardPionts[1])] -= 1; paiArray [int.Parse(chipaiObj.cardPionts[2])] -= 1; } } string hupaiStr = itemData.hu; int huType = -1; if (!string.IsNullOrEmpty(hupaiStr)) { var strList = hupaiStr.Split(':'); hupaiObj.uuid = int.Parse(strList[0]); hupaiObj.cardPiont = int.Parse(strList[1]); hupaiObj.type = strList[2]; //增加判断是否是自己胡牌的判断 huType = MyMahjongScript.checkAvarHupai(parms.uuid, itemData.hu); if (huType == 0) { mdesCribe += "点炮"; } else { if (huType == 1) { mdesCribe += "接炮"; } else if (huType == 2) { mdesCribe += "自摸"; } if (hupaiObj.type == "qingyise") { mdesCribe += "清一色"; } if (hupaiObj.type == "qixiaodui") { mdesCribe += "七小对"; } if (hupaiObj.type == "gangshanghua") { mdesCribe += "杠上花"; } huFlagImg.SetActive(true); paiArray[hupaiObj.cardPiont] -= 1; } } print(" >>>>>>>>>>> hu pai result <<<<<<<<<<<<" + resultDes); resultDes.text = mdesCribe; maPais = parms.getMaPoints(); arrangePai(huType); }
/**整理牌**/ private void arrangePai(int huType) { float startPosition = 30f; GameObject itemTemp; int subPaiConut = 0; if (gangPaiList != null) { for (int i = 0; i < gangPaiList.Count; i++) { GangpaiObj itemgangData = gangPaiList [i]; for (int j = 0; j < 4; j++) { itemTemp = Instantiate(Resources.Load("Prefab/ThrowCard/TopAndBottomCard")) as GameObject; itemTemp.transform.parent = paiArrayPanel.transform; // itemTemp.transform.localScale = new Vector3(0.8f,0.8f,1f); itemTemp.transform.localScale = Vector3.one; itemTemp.GetComponent <TopAndBottomCardScript> ().setPoint(itemgangData.cardPiont); itemTemp.transform.localPosition = new Vector3(startPosition + ((i * 4) + j) * 36f, 0, 0); } } startPosition = startPosition + (gangPaiList.Count > 0 ? (gangPaiList.Count * 4 * 36f + 8f) : 0f); } if (pengpaiList != null) { for (int i = 0; i < pengpaiList.Length; i++) { string cardPoint = pengpaiList [i]; for (int j = 0; j < 3; j++) { itemTemp = Instantiate(Resources.Load("Prefab/ThrowCard/TopAndBottomCard")) as GameObject; itemTemp.transform.parent = paiArrayPanel.transform; //itemTemp.transform.localScale = new Vector3(0.8f,0.8f,1f); itemTemp.transform.localScale = Vector3.one; itemTemp.GetComponent <TopAndBottomCardScript> ().setPoint(int.Parse(cardPoint)); itemTemp.transform.localPosition = new Vector3(startPosition + ((i * 3) + j) * 36f, 0, 0); } } startPosition = startPosition + (pengpaiList.Length > 0 ? (pengpaiList.Length * 3 * 36f + 8f) : 0f); } if (chipaiList != null) { for (int i = 0; i < chipaiList.Count; i++) { ChipaiObj itemgangData = chipaiList [i]; for (int j = 0; j < 3; j++) { itemTemp = Instantiate(Resources.Load("Prefab/ThrowCard/TopAndBottomCard")) as GameObject; itemTemp.transform.parent = paiArrayPanel.transform; //itemTemp.transform.localScale = new Vector3(0.8f,0.8f,1f); itemTemp.transform.localScale = Vector3.one; itemTemp.GetComponent <TopAndBottomCardScript> ().setPoint(int.Parse(itemgangData.cardPionts[j])); itemTemp.transform.localPosition = new Vector3(startPosition + ((i * 3) + j) * 36f, 0, 0); } } startPosition = startPosition + (chipaiList.Count > 0 ? (chipaiList.Count * 3 * 36f + 8f) : 0f); } for (int i = 0; i < paiArray.Length; i++) { if (paiArray [i] > 0) { for (int j = 0; j < paiArray[i]; j++) { itemTemp = Instantiate(Resources.Load("Prefab/ThrowCard/TopAndBottomCard")) as GameObject; itemTemp.transform.parent = paiArrayPanel.transform; itemTemp.transform.localScale = Vector3.one; itemTemp.GetComponent <TopAndBottomCardScript>().setPoint(i); itemTemp.transform.localPosition = new Vector3(startPosition + subPaiConut * 36f, 0, 0); subPaiConut += 1; } } } MyDebug.Log("subPaiConut:" + subPaiConut); startPosition = startPosition + (subPaiConut * 36f + 8f); if (hupaiObj != null) { if (hupaiObj.type == "zi_common" || hupaiObj.type == "d_self" || hupaiObj.type == "qingyise" || hupaiObj.type == "qixiaodui" || hupaiObj.type == "gangshanghua") { itemTemp = Instantiate(Resources.Load("Prefab/ThrowCard/TopAndBottomCard")) as GameObject; itemTemp.transform.parent = paiArrayPanel.transform; //itemTemp.transform.localScale = new Vector3 (0.8f, 0.8f, 1f); itemTemp.transform.localScale = Vector3.one; itemTemp.GetComponent <TopAndBottomCardScript> ().setPoint(hupaiObj.cardPiont); itemTemp.transform.localPosition = new Vector3(startPosition, 0, 0); } startPosition = startPosition + 36f + 52f; } else { startPosition = startPosition + 52f; } //显示中码牌信息==>广东麻将单独处理 if (GlobalDataScript.roomVo.roomType == GameConfig.GAME_TYPE_GUANGDONG && huType == 2) { for (int i = 0; i < validMas.Count; i++) { itemTemp = Instantiate(Resources.Load("Prefab/ThrowCard/ZhongMa")) as GameObject; zhongMaFlag.transform.gameObject.SetActive(true); itemTemp.transform.parent = paiArrayPanel.transform; itemTemp.GetComponent <TopAndBottomCardScript>().setPoint(validMas[i]); itemTemp.transform.localScale = new Vector3(0.8f, 0.8f, 1f); itemTemp.transform.localPosition = new Vector3((20 + i) * 36f, 0, 0); } } else { if (maPais != null && maPais.Count > 0) { for (int i = 0; i < maPais.Count; i++) { itemTemp = Instantiate(Resources.Load("Prefab/ThrowCard/ZhongMa")) as GameObject; if (isMaValid(maPais[i])) { zhongMaFlag.transform.gameObject.SetActive(true); } else { zhongMaFlag.transform.gameObject.SetActive(false); } itemTemp.transform.parent = paiArrayPanel.transform; itemTemp.GetComponent <TopAndBottomCardScript>().setPoint(maPais[i]); itemTemp.transform.localScale = new Vector3(0.8f, 0.8f, 1f); itemTemp.transform.localPosition = new Vector3((20 + i) * 36f, 0, 0); } } } if (GlobalDataScript.roomVo.roomType == GameConfig.GAME_TYPE_HUASHUI) { itemTemp = Instantiate(Resources.Load("Prefab/Image_yu")) as GameObject; itemTemp.transform.parent = paiArrayPanel.transform; itemTemp.GetComponent <yuSetScript> ().setCount(GlobalDataScript.roomVo.xiaYu); itemTemp.transform.localScale = Vector3.one; itemTemp.transform.localPosition = new Vector3(20 * 36f, 0, 0); } //亳州麻将结算界面下嘴显示处理 if (GlobalDataScript.roomVo.roomType == GameConfig.GAME_TYPE_BOZHOU) { itemTemp = Instantiate(Resources.Load("Prefab/Image_xiazui")) as GameObject; itemTemp.transform.parent = paiArrayPanel.transform; if (huType > 0) { itemTemp.GetComponent <XiazuiScript>().setCount(GlobalDataScript.xiazuiVo.xiazuiMultiple); } itemTemp.transform.localScale = Vector3.one; itemTemp.transform.localPosition = new Vector3(20 * 35f, 0, 0); } }
private void analysisPaiInfo(HupaiResponseItem parms) { itemData = parms.totalInfo; string gangpaiStr = itemData.gang; if (gangpaiStr != null && gangpaiStr.Length > 0) { string[] gangtemps = gangpaiStr.Split(new char[1] { ',' }); for (int i = 0; i < gangtemps.Length; i++) { string item = gangtemps [i]; GangpaiObj gangpaiObj = new GangpaiObj(); gangpaiObj.uuid = item.Split(new char[1] { ':' })[0]; gangpaiObj.cardPiont = int.Parse(item.Split(new char[1] { ':' })[1]); gangpaiObj.type = item.Split(new char[1] { ':' })[2]; //增加判断是否为自己的杠牌的操作 paiArray [gangpaiObj.cardPiont] -= 4; gangPaiList.Add(gangpaiObj); if (gangpaiObj.type == "an") { mdesCribe += "暗杠 "; } else { mdesCribe += "明杠 "; } } } string pengpaiStr = itemData.peng; if (pengpaiStr != null && pengpaiStr.Length > 0) { pengpaiList = pengpaiStr.Split(new char[1] { ',' }); //string[] pengpaiListTTT = pengpaiList; List <string> pengpaiListTTT = new List <string>(); for (int i = 0; i < pengpaiList.Length; i++) { if (paiArray [int.Parse(pengpaiList [i])] >= 3) { paiArray [int.Parse(pengpaiList [i])] -= 3; pengpaiListTTT.Add(pengpaiList [i]); } } pengpaiList = pengpaiListTTT.ToArray(); } string chipaiStr = itemData.chi; if (chipaiStr != null && chipaiStr.Length > 0) { string[] chitemps = chipaiStr.Split(new char[1] { ',' }); for (int i = 0; i < chitemps.Length; i++) { string item = chitemps[i]; ChipaiObj chipaiObj = new ChipaiObj(); string[] pointStr = item.Split(new char[1] { ':' }); chipaiObj.cardPionts = pointStr; chipaiList.Add(chipaiObj); paiArray [int.Parse(chipaiObj.cardPionts[0])] -= 1; paiArray [int.Parse(chipaiObj.cardPionts[1])] -= 1; paiArray [int.Parse(chipaiObj.cardPionts[2])] -= 1; } } string hupaiStr = itemData.hu; if (hupaiStr != null && hupaiStr.Length > 0) { hupaiObj.uuid = hupaiStr.Split(new char[1] { ':' }) [0]; hupaiObj.cardPiont = int.Parse(hupaiStr.Split(new char[1] { ':' }) [1]); hupaiObj.type = hupaiStr.Split(new char[1] { ':' }) [2]; //增加判断是否是自己胡牌的判断 if (hupaiStr.Contains("d_other")) //排除一炮多响的情况 { mdesCribe += "点炮"; } else if (hupaiObj.type == "zi_common") { mdesCribe += "自摸"; huFlagImg.SetActive(true); paiArray [hupaiObj.cardPiont] -= 1; } else if (hupaiObj.type == "d_self") { mdesCribe += "接炮"; huFlagImg.SetActive(true); paiArray [hupaiObj.cardPiont] -= 1; } else if (hupaiObj.type == "qiyise") { mdesCribe += "清一色"; huFlagImg.SetActive(true); paiArray [hupaiObj.cardPiont] -= 1; } else if (hupaiObj.type == "zi_qingyise") { mdesCribe += "自摸清一色"; huFlagImg.SetActive(true); paiArray [hupaiObj.cardPiont] -= 1; } else if (hupaiObj.type == "qixiaodui") { mdesCribe += "七小对"; huFlagImg.SetActive(true); paiArray [hupaiObj.cardPiont] -= 1; } else if (hupaiObj.type == "self_qixiaodui") { mdesCribe += "自摸七小对"; huFlagImg.SetActive(true); paiArray [hupaiObj.cardPiont] -= 1; } else if (hupaiObj.type == "gangshangpao") { mdesCribe += "杠上炮"; } else if (hupaiObj.type == "gangshanghua") { mdesCribe += "杠上花"; huFlagImg.SetActive(true); paiArray [hupaiObj.cardPiont] -= 1; } } if (mHupaiResponseItemData.huType != null) { mdesCribe += mHupaiResponseItemData.huType; } resultDes.text = mdesCribe; maPais = parms.getMaPoints(); arrangePai(); }
/**整理牌**/ private void arrangePai(string hu) { float startPosition = 30f; GameObject itemTemp; int subPaiConut = 0; if (gangPaiList != null) { for (int i = 0; i < gangPaiList.Count; i++) { GangpaiObj itemgangData = gangPaiList [i]; for (int j = 0; j < 4; j++) { itemTemp = Instantiate(Resources.Load("Prefab/ThrowCard/TopAndBottomCard")) as GameObject; itemTemp.transform.parent = paiArrayPanel.transform; // itemTemp.transform.localScale = new Vector3(0.8f,0.8f,1f); itemTemp.transform.localScale = Vector3.one; itemTemp.GetComponent <TopAndBottomCardScript> ().setPoint(itemgangData.cardPiont); itemTemp.transform.localPosition = new Vector3(startPosition + ((i * 4) + j) * 36f, 0, 0); } } startPosition = startPosition + (gangPaiList.Count > 0 ? (gangPaiList.Count * 4 * 36f + 8f) : 0f); } if (pengpaiList != null) { for (int i = 0; i < pengpaiList.Length; i++) { string cardPoint = pengpaiList [i]; for (int j = 0; j < 3; j++) { itemTemp = Instantiate(Resources.Load("Prefab/ThrowCard/TopAndBottomCard")) as GameObject; itemTemp.transform.parent = paiArrayPanel.transform; //itemTemp.transform.localScale = new Vector3(0.8f,0.8f,1f); itemTemp.transform.localScale = Vector3.one; itemTemp.GetComponent <TopAndBottomCardScript> ().setPoint(int.Parse(cardPoint)); itemTemp.transform.localPosition = new Vector3(startPosition + ((i * 3) + j) * 36f, 0, 0); } } startPosition = startPosition + (pengpaiList.Length > 0 ? (pengpaiList.Length * 3 * 36f + 8f) : 0f); } if (chipaiList != null) { for (int i = 0; i < chipaiList.Count; i++) { ChipaiObj itemgangData = chipaiList [i]; for (int j = 0; j < 3; j++) { itemTemp = Instantiate(Resources.Load("Prefab/ThrowCard/TopAndBottomCard")) as GameObject; itemTemp.transform.parent = paiArrayPanel.transform; //itemTemp.transform.localScale = new Vector3(0.8f,0.8f,1f); itemTemp.transform.localScale = Vector3.one; itemTemp.GetComponent <TopAndBottomCardScript> ().setPoint(int.Parse(itemgangData.cardPionts[j])); itemTemp.transform.localPosition = new Vector3(startPosition + ((i * 3) + j) * 36f, 0, 0); } } startPosition = startPosition + (chipaiList.Count > 0 ? (chipaiList.Count * 3 * 36f + 8f) : 0f); } for (int i = 0; i < paiArray.Length; i++) { if (paiArray [i] > 0) { for (int j = 0; j < paiArray [i]; j++) { itemTemp = Instantiate(Resources.Load("Prefab/ThrowCard/TopAndBottomCard")) as GameObject; itemTemp.transform.parent = paiArrayPanel.transform; //itemTemp.transform.localScale = new Vector3(0.8f,0.8f,1f); itemTemp.transform.localScale = Vector3.one; itemTemp.GetComponent <TopAndBottomCardScript> ().setPoint(i); if (i == GlobalDataScript.roomVo.guiPai || i == GlobalDataScript.roomVo.guiPai2) { itemTemp.GetComponent <TopAndBottomCardScript> ().showGuiIcon(); } itemTemp.transform.localPosition = new Vector3(startPosition + subPaiConut * 36f, 0, 0); subPaiConut += 1; } } } MyDebug.Log("subPaiConut:" + subPaiConut); startPosition = startPosition + (subPaiConut * 36f + 8f); if (hu != null) { if (hu.Contains("_self") || hu.Contains("zi_common")) { itemTemp = Instantiate(Resources.Load("Prefab/ThrowCard/TopAndBottomCard")) as GameObject; itemTemp.transform.parent = paiArrayPanel.transform; //itemTemp.transform.localScale = new Vector3 (0.8f, 0.8f, 1f); itemTemp.transform.localScale = Vector3.one; itemTemp.GetComponent <TopAndBottomCardScript> ().setPoint(hupaiObj.cardPiont); if (hupaiObj.cardPiont == GlobalDataScript.roomVo.guiPai || hupaiObj.cardPiont == GlobalDataScript.roomVo.guiPai2) { itemTemp.GetComponent <TopAndBottomCardScript> ().showGuiIcon(); } itemTemp.transform.localPosition = new Vector3(startPosition, 0, 0); } startPosition = startPosition + 36f + 52f; } else { startPosition = startPosition + 52f; } //显示中码牌信息==>广东麻将单独处理 if (GlobalDataScript.roomVo.roomType == 4 || GlobalDataScript.roomVo.roomType == 8 || GlobalDataScript.roomVo.roomType == 10) { if (hu != null && hu != "" && (hu.IndexOf("zi_") != -1 || hu.IndexOf("_self") != -1)) { for (int i = 0; i < validMas.Count; i++) { itemTemp = Instantiate(Resources.Load("Prefab/ThrowCard/ZhongMa")) as GameObject; zhongMaFlag.transform.gameObject.SetActive(true); itemTemp.transform.parent = paiArrayPanel.transform; itemTemp.GetComponent <TopAndBottomCardScript> ().setPoint(validMas [i]); itemTemp.transform.localScale = new Vector3(0.8f, 0.8f, 1f); itemTemp.transform.localPosition = new Vector3((20 + i) * 36f, 0, 0); } } } else { if (maPais != null && maPais.Count > 0) { for (int i = 0; i < maPais.Count; i++) { itemTemp = Instantiate(Resources.Load("Prefab/ThrowCard/ZhongMa")) as GameObject; if (isMaValid(maPais[i])) { zhongMaFlag.transform.gameObject.SetActive(true); } else { zhongMaFlag.transform.gameObject.SetActive(false); } itemTemp.transform.parent = paiArrayPanel.transform; itemTemp.GetComponent <TopAndBottomCardScript>().setPoint(maPais[i]); itemTemp.transform.localScale = new Vector3(0.8f, 0.8f, 1f); itemTemp.transform.localPosition = new Vector3((20 + i) * 36f, 0, 0); } } } //划水 if (GlobalDataScript.roomVo.roomType == (int)GameType.GameType_MJ_HuaShui) { itemTemp = Instantiate(Resources.Load("Prefab/Image_yu")) as GameObject; itemTemp.transform.parent = paiArrayPanel.transform; itemTemp.GetComponent <yuSetScript> ().setCount(GlobalDataScript.roomVo.xiaYu); itemTemp.transform.localScale = Vector3.one; itemTemp.transform.localPosition = new Vector3(20 * 36f, 0, 0); } }
private void analysisPaiInfo(HupaiResponseItem parms) { itemData = parms.totalInfo; string gangpaiStr = itemData.gang; if (gangpaiStr != null && gangpaiStr.Length > 0) { string[] gangtemps = gangpaiStr.Split(new char[1] { ',' }); for (int i = 0; i < gangtemps.Length; i++) { string item = gangtemps [i]; GangpaiObj gangpaiObj = new GangpaiObj(); gangpaiObj.uuid = item.Split(new char[1] { ':' })[0]; gangpaiObj.cardPiont = int.Parse(item.Split(new char[1] { ':' })[1]); gangpaiObj.type = item.Split(new char[1] { ':' })[2]; //增加判断是否为自己的杠牌的操作 paiArray [gangpaiObj.cardPiont] -= 4; gangPaiList.Add(gangpaiObj); if (gangpaiObj.type == "an") { mdesCribe += "暗杠 "; } else { mdesCribe += "明杠 "; } } } //20171102 if (GlobalDataScript.roomVo.roomType == 11) { if (parms.shanghuo) { mdesCribe += "上火 "; } else { mdesCribe += "不上火 "; } mdesCribe += "飘数:" + parms.piao + " "; } string pengpaiStr = itemData.peng; if (pengpaiStr != null && pengpaiStr.Length > 0) { pengpaiList = pengpaiStr.Split(new char[1] { ',' }); //string[] pengpaiListTTT = pengpaiList; List <string> pengpaiListTTT = new List <string>(); for (int i = 0; i < pengpaiList.Length; i++) { string[] temp = pengpaiList [i].Split(':'); if (paiArray [int.Parse(temp [0])] >= 3) { paiArray [int.Parse(temp [0])] -= 3; pengpaiListTTT.Add(temp [0]); } } pengpaiList = pengpaiListTTT.ToArray(); } string chipaiStr = itemData.chi; if (chipaiStr != null && chipaiStr.Length > 0) { string[] chitemps = chipaiStr.Split(new char[1] { ',' }); for (int i = 0; i < chitemps.Length; i++) { string item = chitemps[i]; ChipaiObj chipaiObj = new ChipaiObj(); string[] pointStr = item.Split(new char[1] { ':' }); chipaiObj.cardPionts = pointStr; chipaiList.Add(chipaiObj); paiArray [int.Parse(chipaiObj.cardPionts[0])] -= 1; paiArray [int.Parse(chipaiObj.cardPionts[1])] -= 1; paiArray [int.Parse(chipaiObj.cardPionts[2])] -= 1; } } string hupaiStr = itemData.hu; if (hupaiStr != null && hupaiStr.Length > 0) { bool isJian = false; string[] hupai = hupaiStr.Split(new char[1] { ',' }); foreach (string hu in hupai) { if (hu == null || hu.Length == 0) { continue; } hupaiObj.uuid = hu.Split(new char[1] { ':' }) [0]; hupaiObj.cardPiont = int.Parse(hu.Split(new char[1] { ':' }) [1]); hupaiObj.type = hu.Split(new char[1] { ':' }) [2]; //增加判断是否是自己胡牌的判断 if (hupaiStr.Contains("d_other")) //排除一炮多响的情况 { mdesCribe += "点炮"; } else if (hupaiStr.Contains("other_common")) //排除一炮多响的情况 { } else { if (hupaiObj.type == "menqing") { mdesCribe += "门清"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "zi_common") { mdesCribe += "自摸"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "d_self") { mdesCribe += "接炮"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "qiyise") { mdesCribe += "清一色"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "zi_qingyise") { mdesCribe += "自摸清一色"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "qixiaodui") { mdesCribe += "七小对"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "self_qixiaodui") { mdesCribe += "七小对"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "gangshangpao") { mdesCribe += "杠上炮"; } else if (hupaiObj.type == "gangshanghua") { mdesCribe += "杠上花"; huFlagImg.SetActive(true); } //红中宝 else if (hupaiObj.type == "tian_hu") { mdesCribe += "天胡"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "di_hu") { mdesCribe += "地胡"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "chaochaoqidui") { mdesCribe += "超超豪华七对"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "chaoqidui") { mdesCribe += "超豪华七对"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "haohuaqidui") { mdesCribe += "豪华七对"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "quanfengtou") { mdesCribe += "全风头"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "qingyise") { mdesCribe += "清一色"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "hunyise") { mdesCribe += "混一色"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "quanyaojiu") { mdesCribe += "全幺九"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "hunyaojiu") { mdesCribe += "混幺九"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "shisanyao") { mdesCribe += "十三幺"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "shibaluohan") { mdesCribe += "十八罗汉"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "kankanhu") { mdesCribe += "坎坎胡"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "pengpenghu") { mdesCribe += "碰碰胡"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "haidilao") { mdesCribe += "海底捞X2"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "dasixi") { mdesCribe += "大四喜"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "xiaosixi") { mdesCribe += "小四喜"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "dasanyuan") { mdesCribe += "大三元"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "xiaosanyuan") { mdesCribe += "小三元"; huFlagImg.SetActive(true); } //瑞金 else if (hupaiObj.type == "tian_hu") { mdesCribe += "天胡"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "di_hu") { mdesCribe += "地胡"; huFlagImg.SetActive(true); } else if (hupaiObj.type == "jing_diao") { mdesCribe += "飞牌"; huFlagImg.SetActive(true); } if (!isJian) { paiArray [hupaiObj.cardPiont] -= 1; isJian = true; } } mdesCribe += " "; } } if (mHupaiResponseItemData.huType != null) { mdesCribe += mHupaiResponseItemData.huType; } resultDes.text = mdesCribe; maPais = parms.getMaPoints(); arrangePai(hupaiStr); }
/**整理牌**/ private void arrangePai() { float startPosition = 30f; GameObject itemTemp; int subPaiConut = 0; if (gangPaiList != null) { for (int i = 0; i < gangPaiList.Count; i++) { GangpaiObj itemgangData = gangPaiList [i]; for (int j = 0; j < 4; j++) { itemTemp = Instantiate(Resources.Load("Prefab/ThrowCard/TopAndBottomCard")) as GameObject; itemTemp.transform.parent = paiArrayPanel.transform; itemTemp.transform.localScale = new Vector3(1.2f, 1.2f, 1f); itemTemp.GetComponent <TopAndBottomCardScript>().setPoint(itemgangData.cardPiont); itemTemp.transform.localPosition = new Vector3(startPosition + ((i * 4) + j) * 44f, 0, 0); } } startPosition = startPosition + (gangPaiList.Count > 0 ? (gangPaiList.Count * 4 * 44f + 8f) : 0f); } if (pengpaiList != null) { for (int i = 0; i < pengpaiList.Length; i++) { string cardPoint = pengpaiList [i]; for (int j = 0; j < 3; j++) { itemTemp = Instantiate(Resources.Load("Prefab/ThrowCard/TopAndBottomCard")) as GameObject; itemTemp.transform.parent = paiArrayPanel.transform; itemTemp.transform.localScale = new Vector3(1.2f, 1.2f, 1f); itemTemp.GetComponent <TopAndBottomCardScript>().setPoint(int.Parse(cardPoint)); itemTemp.transform.localPosition = new Vector3(startPosition + ((i * 3) + j) * 44f, 0, 0); } } startPosition = startPosition + (pengpaiList.Length > 0 ? (pengpaiList.Length * 3 * 44f + 8f) : 0f); } if (chipaiList != null) { for (int i = 0; i < chipaiList.Count; i++) { ChipaiObj itemgangData = chipaiList [i]; for (int j = 0; j < 3; j++) { itemTemp = Instantiate(Resources.Load("Prefab/ThrowCard/TopAndBottomCard")) as GameObject; itemTemp.transform.parent = paiArrayPanel.transform; itemTemp.transform.localScale = new Vector3(1.2f, 1.2f, 1f); itemTemp.GetComponent <TopAndBottomCardScript>().setPoint(int.Parse(itemgangData.cardPionts [j])); itemTemp.transform.localPosition = new Vector3(startPosition + ((i * 3) + j) * 44f, 0, 0); } } startPosition = startPosition + (chipaiList.Count > 0 ? (chipaiList.Count * 3 * 44f + 8f) : 0f); } bool hasHua = false; float huaPosition = 0; for (int i = 0; i < paiArray.Length; i++) { if (paiArray [i] > 0) { if (i >= NanjingConfig.HUA_INDEX) { continue; hasHua = true; huaPosition = 8; } for (int j = 0; j < paiArray [i]; j++) { itemTemp = Instantiate(Resources.Load("Prefab/ThrowCard/TopAndBottomCard")) as GameObject; itemTemp.transform.parent = paiArrayPanel.transform; itemTemp.transform.localScale = new Vector3(1.2f, 1.2f, 1f); itemTemp.GetComponent <TopAndBottomCardScript>().setPoint(i); itemTemp.transform.localPosition = new Vector3(startPosition + subPaiConut * 44f + huaPosition, 0, 0); subPaiConut += 1; } } } startPosition = startPosition + (subPaiConut * 44f + huaPosition + 8f) + 40f; if (hupaiObj != null) { if (hupaiObj.type == "zi_common" || hupaiObj.type == "d_self") { itemTemp = Instantiate(Resources.Load("Prefab/ThrowCard/TopAndBottomCardHu")) as GameObject; itemTemp.transform.parent = paiArrayPanel.transform; itemTemp.transform.localScale = new Vector3(1.2f, 1.2f, 1f); itemTemp.GetComponent <TopAndBottomCardScript>().setPoint(hupaiObj.cardPiont); itemTemp.transform.localPosition = new Vector3(startPosition, 0, 0); } startPosition = startPosition + 44f + 52f; } else { startPosition = startPosition + 52f; } }