LeagueAnsweringView.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using cfg.GfgCfg;
  4. using ET;
  5. using FairyGUI;
  6. using Hutool;
  7. using UI.League;
  8. using UnityEngine;
  9. namespace GFGGame
  10. {
  11. //联盟答题中
  12. public class LeagueAnsweringView : BaseWindow
  13. {
  14. private UI_LeagueAnsweringUI _ui;
  15. private EffectUI _effectUI1;
  16. private EffectUI _effectUI2;
  17. private List<long> _memberIds; //该玩家id列表,会按照答题数量降序排列
  18. public override void Dispose()
  19. {
  20. EffectUIPool.Recycle(_effectUI1);
  21. _effectUI1 = null;
  22. EffectUIPool.Recycle(_effectUI2);
  23. _effectUI2 = null;
  24. if (_ui != null)
  25. {
  26. _ui.Dispose();
  27. _ui = null;
  28. }
  29. base.Dispose();
  30. }
  31. protected override void OnInit()
  32. {
  33. base.OnInit();
  34. packageName = UI_LeagueAnsweringUI.PACKAGE_NAME;
  35. _ui = UI_LeagueAnsweringUI.Create();
  36. this.viewCom = _ui.target;
  37. isfullScreen = true;
  38. isReturnView = true;
  39. _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("tjbg");
  40. _ui.m_btnBack.onClick.Add(OnBtnBackClick);
  41. _ui.m_btnRule.onClick.Add(OnBtnRuleClick);
  42. _ui.m_btnSend.target.onClick.Add(OnBtnSendClick);
  43. _ui.m_listResult.itemRenderer = RenderListResultItem;
  44. _ui.m_listJoin.itemRenderer = RenderListJoinItem;
  45. _ui.m_listChat.itemRenderer = RenderListChatItem;
  46. _ui.m_listChat.itemProvider = GetListChatItemResource;
  47. _ui.m_listChat.SetVirtual();
  48. //_ui.m_txtResult.onFocusOut.Add(OnFocuseOut);
  49. EffectUIPool.CreateEffectUI(_ui.m_holder, "ui_league", "Answer_bgtx",
  50. onComplete: (effect) =>
  51. {
  52. if (effect != null)
  53. {
  54. _effectUI1 = effect;
  55. }
  56. });
  57. EffectUIPool.CreateEffectUI(_ui.m_holderHead, "ui_league", "Answer_Succeed",
  58. onComplete: (effect) =>
  59. {
  60. if (effect != null)
  61. {
  62. _effectUI2 = effect;
  63. }
  64. });
  65. }
  66. protected override void AddEventListener()
  67. {
  68. base.AddEventListener();
  69. EventAgent.AddEventListener(ConstMessage.LEAGUE_ANSWER_START, UpdateQuestion);
  70. EventAgent.AddEventListener(ConstMessage.LEAGUE_ANSWER_END, UpdateResult);
  71. EventAgent.AddEventListener(ConstMessage.LEAGUE_ANSWER_RESULT_CHANGE, UpdateResult);
  72. EventAgent.AddEventListener(ConstMessage.LEAGUE_ANSWER_RESULT_CHANGE, UpdateJoinList);
  73. EventAgent.AddEventListener(ConstMessage.LEAGUE_ANSWER_MEMBER_CHANGE, UpdateJoinList);
  74. EventAgent.AddEventListener(ConstMessage.NOTICE_CHAT_MESSAGE, UpdateChatList);
  75. EventAgent.AddEventListener(ConstMessage.LEAGUE_ANSWER_INFO, ReferInfo);
  76. }
  77. protected override void RemoveEventListener()
  78. {
  79. EventAgent.RemoveEventListener(ConstMessage.LEAGUE_ANSWER_START, UpdateQuestion);
  80. EventAgent.RemoveEventListener(ConstMessage.LEAGUE_ANSWER_END, UpdateResult);
  81. EventAgent.RemoveEventListener(ConstMessage.LEAGUE_ANSWER_RESULT_CHANGE, UpdateResult);
  82. EventAgent.RemoveEventListener(ConstMessage.LEAGUE_ANSWER_RESULT_CHANGE, UpdateJoinList);
  83. EventAgent.RemoveEventListener(ConstMessage.LEAGUE_ANSWER_MEMBER_CHANGE, UpdateJoinList);
  84. EventAgent.RemoveEventListener(ConstMessage.NOTICE_CHAT_MESSAGE, UpdateChatList);
  85. EventAgent.RemoveEventListener(ConstMessage.LEAGUE_ANSWER_INFO, ReferInfo);
  86. base.RemoveEventListener();
  87. }
  88. protected override void OnShown()
  89. {
  90. base.OnShown();
  91. LeagueSproxy.ReqJoinAnswer().Coroutine();
  92. }
  93. protected override void OnHide()
  94. {
  95. base.OnHide();
  96. Timers.inst.Remove(UpdateAnswerTime);
  97. Timers.inst.Remove(UpdateResultTime);
  98. Timers.inst.Remove(UpdateActiveTime);
  99. _ui.m_holderHead.visible = false;
  100. }
  101. private void ReferInfo()
  102. {
  103. UpdateJoinList();
  104. UpdateQuestionState();
  105. UpdateChatList();
  106. Timers.inst.Add(1, 0, UpdateActiveTime);
  107. }
  108. private void OnBtnBackClick()
  109. {
  110. if (LeagueDataManager.Instance.LastAnswerRoleData.LastQuestionResult == LastQuestionResult.Ending)
  111. {
  112. LeagueSproxy.ReqQuitAnswer().Coroutine();
  113. // ViewManager.GoBackFrom(typeof(LeagueAnsweringView).FullName);
  114. Hide();
  115. }
  116. else
  117. {
  118. AlertUI.Show("退出活动会损失奖励哦,是否仍要退出?")
  119. .SetLeftButton(true, "否")
  120. .SetRightButton(true, "是", (object data) =>
  121. {
  122. LeagueSproxy.ReqQuitAnswer().Coroutine();
  123. // ViewManager.GoBackFrom(typeof(LeagueAnsweringView).FullName);
  124. Hide();
  125. });
  126. }
  127. }
  128. private void OnBtnRuleClick()
  129. {
  130. ViewManager.Show<LeagueAnswerRewardView>();
  131. }
  132. private async void OnBtnSendClick()
  133. {
  134. if (_ui.m_btnSend.m_c1.selectedIndex == 1)
  135. {
  136. PromptController.Instance.ShowFloatTextPrompt("消息发送频繁");
  137. return;
  138. }
  139. if (string.IsNullOrEmpty(_ui.m_txtChat.text))
  140. {
  141. PromptController.Instance.ShowFloatTextPrompt("还没有输入想发送的内容哦");
  142. return;
  143. }
  144. bool result = await ChatSProxy.ReqSendChatMsg(ChatType.LeagueQuestion, _ui.m_txtChat.text);
  145. if (result)
  146. {
  147. _ui.m_txtChat.text = "";
  148. UpdateChatList();
  149. int num = CommonDataManager.Tables.TblGlobalCfg.ChatTime;
  150. _ui.m_btnSend.m_timeStr.text = num.ToString();
  151. _ui.m_btnSend.m_c1.selectedIndex = 1;
  152. Timers.inst.Add(1, 10, (param) =>
  153. {
  154. num--;
  155. _ui.m_btnSend.m_timeStr.text = num.ToString();
  156. if (num == 0)
  157. {
  158. _ui.m_btnSend.m_c1.selectedIndex = 0;
  159. }
  160. });
  161. }
  162. }
  163. private void UpdateActiveTime(object param)
  164. {
  165. long curTime = TimeHelper.ServerNow();
  166. long endTime = 0;
  167. string str = "";
  168. //leagueQuestionStartTimeArr与leagueQuestionCloseTimeArr与leagueQuestionEndTimeArr数组长度相同,且索引对应。跟曾威定的
  169. int curIndex =
  170. DateUtil.GetNearestStartTimeIndex(CommonDataManager.Tables.TblGlobalCfg.LeagueQuestionCloseTime);
  171. if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) ==
  172. LeagueQuestionStatus.End
  173. || LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) ==
  174. LeagueQuestionStatus.AnswerEnd)
  175. {
  176. endTime = TimeUtil.GetCurDayTime(
  177. CommonDataManager.Tables.TblGlobalCfg.LeagueQuestionCloseTime[curIndex]);
  178. str = "房间剩余时间 ";
  179. }
  180. else
  181. {
  182. endTime = TimeUtil.GetCurDayTime(CommonDataManager.Tables.TblGlobalCfg.LeagueQuestionEndTime[curIndex]);
  183. str = "活动剩余时间 ";
  184. }
  185. if (endTime - curTime < 0 &&
  186. LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) ==
  187. LeagueQuestionStatus.End)
  188. {
  189. Timers.inst.Remove(UpdateResultTime);
  190. // ViewManager.GoBackFrom(typeof(LeagueAnsweringView).FullName);
  191. Hide();
  192. return;
  193. }
  194. _ui.m_txtTime.text = string.Format("{0}[color=#E07748]{1}[/color]", str,
  195. TimeUtil.FormattingTimeTo_mmss(endTime - curTime));
  196. }
  197. private void UpdateQuestionState()
  198. {
  199. if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) ==
  200. LeagueQuestionStatus.Open) //答题中
  201. {
  202. UpdateQuestion();
  203. }
  204. else //cd中、答题结束
  205. {
  206. UpdateResult();
  207. }
  208. UpdateJoinList();
  209. }
  210. private void UpdateQuestion()
  211. {
  212. _ui.m_holderHead.visible = false;
  213. _ui.m_txtRightCount.SetVar("value",
  214. LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionTrueCount).ToString())
  215. .FlushVars();
  216. ;
  217. _ui.m_txtRightCount1.SetVar("value",
  218. LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionTrueCount).ToString())
  219. .FlushVars();
  220. ;
  221. _ui.m_ctrlQuestionState.selectedIndex = 0;
  222. int questionId = (int)LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionId);
  223. LeagueQuestionCfg questionCfg = CommonDataManager.Tables.TblLeagueQuestionCfg.GetOrDefault(questionId);
  224. _ui.m_txtAnswerNum.text = string.Format("第{0}/{1}题",
  225. LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionCount),
  226. CommonDataManager.Tables.TblGlobalCfg.LeagueQuestionNum);
  227. _ui.m_ctrlHasIcon.selectedIndex = string.IsNullOrEmpty(questionCfg.Res) ? 1 : 0;
  228. _ui.m_loaIocn.url = string.IsNullOrEmpty(questionCfg.Res)
  229. ? ""
  230. : ResPathUtil.GetIconPath(questionCfg.Res, "png");
  231. _ui.m_txtContent.text = questionCfg.Question;
  232. bool isAnswer = !string.IsNullOrEmpty(LeagueDataManager.Instance.LastAnswerRoleData.MyAnswer) &&
  233. LeagueDataManager.Instance.LastAnswerRoleData.LastQuestionId ==
  234. LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionId);
  235. _ui.m_txtResult.text = isAnswer ? LeagueDataManager.Instance.LastAnswerRoleData.MyAnswer : "";
  236. _ui.m_txtResult.enabled = !(isAnswer &&
  237. LeagueDataManager.Instance.LastAnswerRoleData.MyAnswer !=
  238. questionCfg.AnswerCorrect);
  239. _ui.m_imgFault.visible = isAnswer &&
  240. LeagueDataManager.Instance.LastAnswerRoleData.MyAnswer !=
  241. questionCfg.AnswerCorrect;
  242. _ui.m_ctrlQuestionType.selectedIndex = questionCfg.Type;
  243. if (questionCfg.Type == 1)
  244. {
  245. _ui.m_listResult.numItems = questionCfg.Answer.Count;
  246. }
  247. _ui.m_txtAnswerTime.text = "00:" + CommonDataManager.Tables.TblGlobalCfg.LeagueQuestionRunTime;
  248. Timers.inst.Remove(UpdateAnswerTime);
  249. Timers.inst.Add(1, 0, UpdateAnswerTime);
  250. }
  251. private void UpdateAnswerTime(object param)
  252. {
  253. long curTime = TimeHelper.ServerNow();
  254. long endTime = LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatusEndTime);
  255. if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) ==
  256. LeagueQuestionStatus.End
  257. || LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) ==
  258. LeagueQuestionStatus.AnswerEnd
  259. || endTime - curTime < 0)
  260. {
  261. Debug.Log("endTime:" + endTime + " curTime:" + curTime);
  262. Timers.inst.Remove(UpdateAnswerTime);
  263. return;
  264. }
  265. _ui.m_txtAnswerTime.text = TimeUtil.FormattingTimeTo_mmss((int)(endTime - curTime));
  266. }
  267. private void UpdateResult()
  268. {
  269. _ui.m_ctrlResult.selectedIndex = LeagueDataManager.Instance.LastAnswerRoleData.LastQuestionResult;
  270. _ui.m_txtRightCount.text = string.Format("全员已答对[color=#AF5638]{0}[/color]题",
  271. LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionTrueCount));
  272. _ui.m_txtRightCount.SetVar("value",
  273. LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionTrueCount).ToString())
  274. .FlushVars();
  275. _ui.m_txtRightCount1.SetVar("value",
  276. LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionTrueCount).ToString())
  277. .FlushVars();
  278. _ui.m_txtCdTime.SetVar("value", CommonDataManager.Tables.TblGlobalCfg.LeagueQuestionNextTime.ToString())
  279. .FlushVars();
  280. _ui.m_ctrlQuestionState.selectedIndex = 1;
  281. if (LeagueDataManager.Instance.LastAnswerRoleData.LastQuestionResult == LastQuestionResult.SomeBodyRight)
  282. {
  283. _ui.m_comRightHead.target.visible = true;
  284. _ui.m_imgFail.visible = false;
  285. OtherRoleInfoData roleInfoData =
  286. LeagueDataManager.Instance.GetMemberRoleInfo(LeagueDataManager.Instance.LastAnswerRoleData
  287. .RightRoleId);
  288. ItemCfg headCfg =
  289. CommonDataManager.Tables.TblItemCfg.GetOrDefault(roleInfoData.headId == 0
  290. ? ConstItemID.HEADID
  291. : roleInfoData.headId);
  292. _ui.m_comRightHead.m_loaIcon.url = ResPathUtil.GetHeadPath(headCfg.Res);
  293. _ui.m_txtInfo.text = string.Format("{0} [color=#915E15]答对了![/color]", roleInfoData.roleName);
  294. _ui.m_holderHead.visible = true;
  295. Timers.inst.Remove(UpdateResultTime);
  296. Timers.inst.Add(1, 0, UpdateResultTime);
  297. }
  298. else if (LeagueDataManager.Instance.LastAnswerRoleData.LastQuestionResult == LastQuestionResult.NobodyRight)
  299. {
  300. _ui.m_comRightHead.target.visible = false;
  301. _ui.m_imgFail.visible = true;
  302. _ui.m_txtInfo.text = "哎呀,没人答对呀,大家加油鸭~";
  303. Timers.inst.Remove(UpdateResultTime);
  304. Timers.inst.Add(1, 0, UpdateResultTime);
  305. }
  306. else
  307. {
  308. _ui.m_comRightHead.target.visible = false;
  309. _ui.m_imgFail.visible = false;
  310. if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionCount) ==
  311. CommonDataManager.Tables.TblGlobalCfg.LeagueQuestionNum) //全部答完
  312. {
  313. _ui.m_txtInfo.text = "全部题目答完啦,活动结束啦~";
  314. }
  315. else //答题时间结束
  316. {
  317. _ui.m_txtInfo.text = "活动结束啦~";
  318. }
  319. }
  320. }
  321. private void UpdateResultTime(object param)
  322. {
  323. long curTime = TimeHelper.ServerNow();
  324. long endTime = LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatusEndTime);
  325. if (LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionStatus) !=
  326. LeagueQuestionStatus.WaitNext
  327. || endTime - curTime < 0)
  328. {
  329. Timers.inst.Remove(UpdateResultTime);
  330. return;
  331. }
  332. _ui.m_txtCdTime.SetVar("value", (((endTime - curTime) / 1000) + 1).ToString()).FlushVars();
  333. }
  334. private void UpdateJoinList()
  335. {
  336. _memberIds = LeagueDataManager.Instance.ListAnsweringDatas
  337. .OrderByDescending(pair => pair.Value) // 按值(答题数量)降序排序
  338. .Select(pair => pair.Key)
  339. .ToList();
  340. _ui.m_listJoin.numItems = _memberIds.Count;
  341. _ui.m_txtJoinNum.text = string.Format("当前参与人员:{0}/{1}", _memberIds.Count,
  342. LeagueDataManager.Instance.LeagueData.LeagueMemberDatas.Count);
  343. }
  344. private void UpdateChatList()
  345. {
  346. _memberIds.Sort((long a, long b) =>
  347. {
  348. int countA = LeagueDataManager.Instance.ListAnsweringDatas[a];
  349. int countB = LeagueDataManager.Instance.ListAnsweringDatas[b];
  350. if (countA > countB) return -1;
  351. if (countB > countA) return 1;
  352. return countB - countA;
  353. });
  354. _ui.m_listChat.numItems = ChatDataManager.Instance.GetChatDatas(ChatType.LeagueQuestion).Count;
  355. _ui.m_listChat.scrollPane.ScrollBottom(true);
  356. }
  357. private void RenderListResultItem(int index, GObject obj)
  358. {
  359. int questionId = (int)LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionId);
  360. LeagueQuestionCfg cfg = CommonDataManager.Tables.TblLeagueQuestionCfg.GetOrDefault(questionId);
  361. ;
  362. UI_Button123 item = UI_Button123.Proxy(obj);
  363. int data = index + 1;
  364. item.target.title = string.Format("{0}.{1}", data, cfg.Answer[index]);
  365. //测试 正确答案
  366. //if (data == int.Parse(cfg.answerCorrect))
  367. //{
  368. // item.target.title = string.Format("{0}.{1} 正确", data, cfg.answerArr[index]);
  369. //}
  370. string myAnswer = LeagueDataManager.Instance.LastAnswerRoleData.MyAnswer;
  371. bool isAnswer = !string.IsNullOrEmpty(LeagueDataManager.Instance.LastAnswerRoleData.MyAnswer) &&
  372. LeagueDataManager.Instance.LastAnswerRoleData.LastQuestionId ==
  373. LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionId);
  374. item.target.touchable = !isAnswer;
  375. item.m_c1.selectedIndex =
  376. isAnswer && myAnswer == data.ToString() && myAnswer != cfg.AnswerCorrect.ToString() ? 0 : 1;
  377. if (item.target.data == null)
  378. {
  379. item.target.onClick.Add(OnBtnChooseClick);
  380. }
  381. item.target.data = data;
  382. UI_Button123.ProxyEnd();
  383. }
  384. private async void OnBtnChooseClick(EventContext context)
  385. {
  386. GObject obj = context.sender as GObject;
  387. string answer = obj.data.ToString();
  388. int questionId = (int)LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionId);
  389. LeagueQuestionCfg cfg = CommonDataManager.Tables.TblLeagueQuestionCfg.GetOrDefault(questionId);
  390. bool result = await LeagueSproxy.ReqAnswerQuestion(questionId, answer);
  391. if (result)
  392. {
  393. _ui.m_listResult.numItems = cfg.Answer.Count;
  394. }
  395. }
  396. private async void OnFocuseOut()
  397. {
  398. if (string.IsNullOrEmpty(_ui.m_txtResult.text))
  399. {
  400. PromptController.Instance.ShowFloatTextPrompt("还没有输入答案哦");
  401. return;
  402. }
  403. int questionId = (int)LeagueDataManager.Instance.GetNumeriValue(LeagueNumericType.LeagueQuestionId);
  404. bool result = await LeagueSproxy.ReqAnswerQuestion(questionId, _ui.m_txtResult.text);
  405. if (result)
  406. {
  407. LeagueQuestionCfg questionCfg = CommonDataManager.Tables.TblLeagueQuestionCfg.GetOrDefault(questionId);
  408. _ui.m_txtResult.enabled = false;
  409. _ui.m_imgFault.visible = _ui.m_txtResult.text != questionCfg.AnswerCorrect;
  410. }
  411. }
  412. private void RenderListJoinItem(int index, GObject obj)
  413. {
  414. OtherRoleInfoData roleInfo = LeagueDataManager.Instance.GetMemberRoleInfo(_memberIds[index]);
  415. UI_ListAnswerJoinItem item = UI_ListAnswerJoinItem.Proxy(obj);
  416. RoleInfoManager.Instance.UpdateHead(item.m_comHead, roleInfo.headId, roleInfo.headBorderId);
  417. item.m_txtName.text = roleInfo.roleName;
  418. item.m_txtAnswerCount.text = LeagueDataManager.Instance.ListAnsweringDatas[roleInfo.roleId].ToString();
  419. UI_ListAnswerJoinItem.ProxyEnd();
  420. }
  421. private void RenderListChatItem(int index, GObject obj)
  422. {
  423. ChatData chatData = ChatDataManager.Instance.ChatDatas[ChatType.LeagueQuestion][index];
  424. OtherRoleInfoData roleInfo = chatData.RoleInfo;
  425. UI_ListChatAnswerItem item = UI_ListChatAnswerItem.Proxy(obj);
  426. RoleInfoManager.Instance.UpdateHeadWithLv(item.m_comHead, roleInfo.headId, roleInfo.headBorderId,
  427. roleInfo.roleLv);
  428. item.m_txtName.text = roleInfo.roleName;
  429. int roldRank = _memberIds.IndexOf(roleInfo.roleId);
  430. item.m_c1.selectedIndex = roldRank < 3 && roldRank > 0 ? roldRank : 3;
  431. string content = "";
  432. for (int i = 0; i < chatData.Content.Length; i++)
  433. {
  434. string str = i == 12 * (i + 1) ? chatData.Content[i] + "/n" : chatData.Content[i].ToString();
  435. content += str;
  436. }
  437. item.m_txtChatContent.text = chatData.Content;
  438. UI_ListChatAnswerItem.ProxyEnd();
  439. }
  440. private string GetListChatItemResource(int index)
  441. {
  442. if (ChatDataManager.Instance.GetChatDatas(ChatType.LeagueQuestion)[index].RoleInfo.roleId ==
  443. RoleDataManager.roleId)
  444. return "ui://League/ListChatAnswerItemMine";
  445. else
  446. return "ui://League/ListChatAnswerItem";
  447. }
  448. }
  449. }