private void profile(MessageBean message) { if (message.statusCode == StatusCode.SUCCESS) { BLOKUSProfile bLOKUSProfile = ProtobufHelper.DederializerFromBytes <BLOKUSProfile>(message.data); GameObject.Find("UIController").SendMessage("onShowProfile", bLOKUSProfile); } }
public void onShowProfile(BLOKUSProfile profile) { foreach (GameObject gameObject in playerGameLogList) { Destroy(gameObject); } playerGameLogList.Clear(); BLOKUSRankItem bLOKUSRankItem2 = profile.twoPlayersRankItem; BLOKUSRankItem bLOKUSRankItem4 = profile.fourPlayersRankItem; profileRankScoreText2.text = bLOKUSRankItem2.rankScore + ""; profileRecordDetailText2.text = "win:" + bLOKUSRankItem2.winCount + " lose:" + bLOKUSRankItem2.loseCount + " escape:" + bLOKUSRankItem2.escapeCount; profileRankScoreText4.text = bLOKUSRankItem4.rankScore + ""; profileRecordDetailText4.text = "win:" + bLOKUSRankItem4.winCount + " lose:" + bLOKUSRankItem4.loseCount + " escape:" + bLOKUSRankItem4.escapeCount; foreach (BLOKUSPlayerGameLogItem gameLogItem in profile.playerGameLogs) { GameObject logItemObject = Instantiate(LogItem, playerGameLogContent.transform, false); playerGameLogList.Add(logItemObject); LogItemData logItemData = logItemObject.GetComponent <LogItemData>(); if ("win".Equals(gameLogItem.result)) { logItemData.resultText.color = new UnityEngine.Color(0.2588F, 0.6549F, 0.2274F, 1); } else if ("lose".Equals(gameLogItem.result)) { logItemData.resultText.color = new UnityEngine.Color(0.9411F, 0.098F, 0.098F, 1); } else { logItemData.resultText.color = new UnityEngine.Color(1, 0.6862F, 0.047F, 1); } logItemData.result = gameLogItem.result; logItemData.stepsCount = gameLogItem.stepsCount + ""; if (GameType.BLOKUS_FOUR == gameLogItem.gameType) { logItemData.gameType = "4 players"; } else { logItemData.gameType = "2 players"; } logItemData.detail = gameLogItem.detail; logItemData.time = gameLogItem.time; logItemData.score = gameLogItem.changeScore + ""; logItemData.ShowGameLogInfo(); } }