MatchingTwoDataManager.cs 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. using ET;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.Text.RegularExpressions;
  6. using UnityEngine;
  7. using Live2D.Cubism.Rendering;
  8. using FairyGUI;
  9. using UI.MatchingCompetition;
  10. namespace GFGGame
  11. {
  12. class MatchingLeftDataManager : SingletonBase<MatchingLeftDataManager>
  13. {
  14. //其他玩家信息用于展示
  15. public MatchingPhotoWorksData LeftRoleInfo = new MatchingPhotoWorksData();
  16. //人物位置信息
  17. public TransformData roleTransFormData = new TransformData();
  18. public GameObject roleGameobj;
  19. public int roleID = -1;
  20. //*********************搭配数据*********************************
  21. //需要传输的数据:MathingDressDate,DressUpBgID,DressPropIdList,TransformDataList,
  22. public DressUpData MathingDressDate = DressUpData.CreateDefault();
  23. public int DressUpBgID = 0;
  24. //*****这两个id放列表的最后面
  25. //边框id
  26. public int BorderID = 0;
  27. //NpcId
  28. public int NpcID = 0;
  29. //道具数据,一一对应
  30. //道具id
  31. public List<int> DressPropIdList = new List<int>();
  32. //道具位置信息
  33. public List<TransformData> TransformDataList = new List<TransformData>();
  34. public List<GameObject> itemGameObjs = new List<GameObject>();
  35. //***************************************************************
  36. //解析后台获取的信息
  37. public void AnalysisInfoToList()
  38. {
  39. List<int> dressitemIDList = new List<int>();
  40. List<int> propIDList = new List<int>();
  41. List<TransformData> transDataList = new List<TransformData>();
  42. for (int i = 0; i < LeftRoleInfo.JudgingInfo.CollocationInfoList.Count; i++)
  43. {
  44. if (LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId == roleID)
  45. {
  46. propIDList.Add(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
  47. }
  48. else
  49. {
  50. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
  51. if (itemCfg != null && itemCfg.itemType == ConstItemType.DRESS_UP)
  52. {
  53. if (itemCfg.subType == 9 || itemCfg.subType == 10 || itemCfg.subType == 11 || itemCfg.subType == 12)
  54. {
  55. //记录道具和位置信息
  56. propIDList.Add(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
  57. transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ClientPosition));
  58. }
  59. else
  60. {
  61. dressitemIDList.Add(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
  62. }
  63. }
  64. else if (itemCfg != null && itemCfg.itemType == ConstItemType.PHOTOGRAPH)
  65. {
  66. //记录道具和位置信息
  67. propIDList.Add(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
  68. transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ClientPosition));
  69. }
  70. }
  71. }
  72. MathingDressDate.itemList = dressitemIDList;
  73. MathingDressDate.actionId = LeftRoleInfo.JudgingInfo.ActionId;
  74. DressPropIdList = propIDList;
  75. TransformDataList = transDataList;
  76. DressUpBgID = LeftRoleInfo.JudgingInfo.BagId;
  77. }
  78. public void InsertGameObjectList()
  79. {
  80. int indexRoleData = 0;
  81. for (int i = 0; i < DressPropIdList.Count; i++)
  82. {
  83. if (DressPropIdList[i] == roleID)
  84. {
  85. indexRoleData = i;
  86. }
  87. }
  88. if (itemGameObjs.Count == 0)
  89. {
  90. itemGameObjs.Add(roleGameobj);
  91. }
  92. else
  93. {
  94. itemGameObjs.Insert(indexRoleData, roleGameobj);
  95. }
  96. }
  97. }
  98. class MatchingRightDataManager : SingletonBase<MatchingRightDataManager>
  99. {
  100. //其他玩家信息用于展示
  101. public MatchingPhotoWorksData RightRoleInfo = new MatchingPhotoWorksData();
  102. //人物位置信息
  103. public TransformData roleTransFormData = new TransformData();
  104. public GameObject roleGameobj;
  105. public int roleID = -1;
  106. //*********************搭配数据*********************************
  107. //需要传输的数据:MathingDressDate,DressUpBgID,DressPropIdList,TransformDataList,
  108. public DressUpData MathingDressDate = DressUpData.CreateDefault();
  109. public int DressUpBgID = 0;
  110. //*****这两个id放列表的最后面
  111. //边框id
  112. public int BorderID = 0;
  113. //NpcId
  114. public int NpcID = 0;
  115. //道具数据,一一对应
  116. //道具id
  117. public List<int> DressPropIdList = new List<int>();
  118. //道具位置信息
  119. public List<TransformData> TransformDataList = new List<TransformData>();
  120. public List<GameObject> itemGameObjs = new List<GameObject>();
  121. //***************************************************************
  122. //解析后台获取的信息
  123. public void AnalysisInfoToList()
  124. {
  125. List<int> dressitemIDList = new List<int>();
  126. List<int> propIDList = new List<int>();
  127. List<TransformData> transDataList = new List<TransformData>();
  128. for (int i = 0; i < RightRoleInfo.JudgingInfo.CollocationInfoList.Count; i++)
  129. {
  130. if (RightRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId == roleID)
  131. {
  132. propIDList.Add(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
  133. }
  134. else
  135. {
  136. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
  137. if (itemCfg != null && itemCfg.itemType == ConstItemType.DRESS_UP)
  138. {
  139. if (itemCfg.subType == 9 || itemCfg.subType == 10 || itemCfg.subType == 11 || itemCfg.subType == 12)
  140. {
  141. //记录道具和位置信息
  142. propIDList.Add(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
  143. transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ClientPosition));
  144. }
  145. else
  146. {
  147. dressitemIDList.Add(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
  148. }
  149. }
  150. else if (itemCfg != null && itemCfg.itemType == ConstItemType.PHOTOGRAPH)
  151. {
  152. //记录道具和位置信息
  153. propIDList.Add(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
  154. transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ClientPosition));
  155. }
  156. }
  157. }
  158. MathingDressDate.itemList = dressitemIDList;
  159. MathingDressDate.actionId = RightRoleInfo.JudgingInfo.ActionId;
  160. DressPropIdList = propIDList;
  161. TransformDataList = transDataList;
  162. DressUpBgID = RightRoleInfo.JudgingInfo.BagId;
  163. }
  164. public void InsertGameObjectList()
  165. {
  166. int indexRoleData = 0;
  167. for (int i = 0; i < DressPropIdList.Count; i++)
  168. {
  169. if (DressPropIdList[i] == roleID)
  170. {
  171. indexRoleData = i;
  172. }
  173. }
  174. if (itemGameObjs.Count == 0)
  175. {
  176. itemGameObjs.Add(roleGameobj);
  177. }
  178. else
  179. {
  180. itemGameObjs.Insert(indexRoleData, roleGameobj);
  181. }
  182. }
  183. }
  184. }