MatchingCompetitionDataManager.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  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 MatchingCompetitionDataManager : SingletonBase<MatchingCompetitionDataManager>
  13. {
  14. ////搭配赛标记
  15. //public int type = 2;
  16. //位置信息数据索引
  17. public int indexRoleData = 0;
  18. //人物位置信息
  19. public TransformData roleTransFormData = new TransformData();
  20. public GameObject roleGameobj;
  21. public string roleID = "Role";
  22. //*********************搭配数据*********************************
  23. //需要传输的数据:MathingDressDate,DressUpBgID,DressPropIdList,TransformDataList,
  24. public DressUpData MathingDressDate = DressUpData.CreateDefault();
  25. public int DressUpBgID = 0;
  26. //*****这两个id放列表的最后面
  27. //边框id
  28. public int BorderID = 0;
  29. //NpcId
  30. public int NpcID = 0;
  31. //*************=**************
  32. //道具数据,一一对应
  33. //场景名字,自己搭配的数据
  34. public List<string> DressPropNameList = new List<string>();
  35. //道具id
  36. //public List<int> DressPropIdList = new List<int>();
  37. //道具索引
  38. public int DressPropIndex = 0;
  39. //道具索引字典
  40. public Dictionary<string, TransformData> DressPropTransInfoDic = new Dictionary<string, TransformData>();
  41. //道具位置信息
  42. public List<TransformData> TransformDataList = new List<TransformData>();
  43. public List<GameObject> itemGameObjs = new List<GameObject>();
  44. //所有信息的列表,用于前后端交互
  45. public List<CollocationInfo> AllDressIDInfoList = new List<CollocationInfo>();
  46. //public List<int> _equipSceneData = new List<int>();//当前穿戴的场景数据(从套装获得)
  47. //***************************************************************
  48. public int MatchingCompetitionSeason = 1;
  49. public int MatchingState = 1;
  50. public long MatchingEndTimes = 0;
  51. public long WorksID = 0;
  52. public string TempPictureUrl = "";
  53. public int MatchingRemainingTimes = 1;
  54. public MyWorksIdInfo myWorks = new MyWorksIdInfo();
  55. public List<ItemInfoProto> SpecialBonusList = new List<ItemInfoProto>();
  56. /// <summary>
  57. /// 搭配赛相册
  58. /// </summary>
  59. /// <typeparam name="PoemPhotoData"></typeparam>
  60. /// <returns></returns>
  61. public List<PoemPhotoData> MatchingPhotoInfos = new List<PoemPhotoData>();
  62. //角色详情界面图片信息
  63. public NTexture DetailNtexture;
  64. //自己的搭配图片
  65. public NTexture MyNtextture;
  66. public byte[] MyBytes;
  67. //本期排行榜数据
  68. public List<MatchingPhotoWorksData> _currentRankList = new List<MatchingPhotoWorksData>();
  69. //往期作品集
  70. public List<MatchingWorksData> _BeforeWorksList = new List<MatchingWorksData>();
  71. //往期排行榜数据
  72. public List<MatchingPhotoWorksData> _BeforeRankList = new List<MatchingPhotoWorksData>();
  73. //根据时间判断:1:集结期 2:评选期 3;结算期
  74. //public int CheckCompetitionState()
  75. //{
  76. // long currentTime = TimeHelper.ServerNow();
  77. // DateTime dateTime = DateTimeOffset.FromUnixTimeSeconds(currentTime).DateTime;
  78. // // 获取星期几
  79. // DayOfWeek dayOfWeek = dateTime.DayOfWeek;
  80. // int week = (int)dayOfWeek;
  81. // int hour = dateTime.Hour;
  82. // if(week == 0)
  83. // {
  84. // if(hour >= 21)
  85. // {
  86. // return 3;
  87. // }
  88. // else
  89. // {
  90. // return 2;
  91. // }
  92. // }
  93. // if(week <= 3 && week >= 1)
  94. // {
  95. // if(week == 3 && hour >= 5)
  96. // {
  97. // return 2;
  98. // }
  99. // if(week == 1 && hour < 5)
  100. // {
  101. // return 3;
  102. // }
  103. // return 1;
  104. // }
  105. // else if(week > 3 && week <= 6)
  106. // {
  107. // return 2;
  108. // }
  109. // return -1;
  110. //}
  111. public void ConvertInfoToList()
  112. {
  113. //将所有需要存储的信息转换成list
  114. AllDressIDInfoList.Clear();
  115. foreach(var item in MathingDressDate.itemList)
  116. {
  117. CollocationInfo itemInfo = new CollocationInfo();
  118. itemInfo.ItemId = item.ToString();
  119. itemInfo.ClientPosition = "";
  120. AllDressIDInfoList.Add(itemInfo);
  121. }
  122. foreach (var item in DressPropTransInfoDic)
  123. {
  124. CollocationInfo itemInfo = new CollocationInfo();
  125. itemInfo.ItemId = item.Key;
  126. string transStr = item.Value.position.x.ToString() + "_" + item.Value.position.y.ToString() + "_"
  127. + item.Value.position.z.ToString()
  128. + "_" + item.Value.rotationZ.ToString()
  129. + "_" + item.Value.scale.x.ToString() + "_" +
  130. item.Value.scale.y.ToString() + "_" + item.Value.scale.z.ToString();
  131. itemInfo.ClientPosition = transStr;
  132. AllDressIDInfoList.Add(itemInfo);
  133. }
  134. //for(int i = 0;i< DressPropIdList.Count;i++)
  135. //{
  136. // CollocationInfo itemInfo = new CollocationInfo();
  137. // itemInfo.ItemId = DressPropIdList[i];
  138. // string transStr = TransformDataList[i].position.x.ToString()+"_" + TransformDataList[i].position.y.ToString() + "_"
  139. // + TransformDataList[i].position.z.ToString()
  140. // + "_" + TransformDataList[i].rotationZ.ToString()
  141. // + "_" + TransformDataList[i].scale.x.ToString() + "_" +
  142. // TransformDataList[i].scale.y.ToString() + "_" + TransformDataList[i].scale.z.ToString();
  143. // itemInfo.ClientPosition = transStr;
  144. // AllDressIDInfoList.Add(itemInfo);
  145. //}
  146. CollocationInfo itemBgInfo = new CollocationInfo();
  147. itemBgInfo.ItemId = MatchingCompetitionDataManager.Instance.DressUpBgID.ToString();
  148. itemBgInfo.ClientPosition = "";
  149. AllDressIDInfoList.Add(itemBgInfo);
  150. CollocationInfo itemActionInfo = new CollocationInfo();
  151. itemActionInfo.ItemId = MatchingCompetitionDataManager.Instance.MathingDressDate.actionId.ToString();
  152. itemActionInfo.ClientPosition = "";
  153. AllDressIDInfoList.Add(itemActionInfo);
  154. }
  155. //解析后台获取的信息
  156. public void AnalysisInfoToList()
  157. {
  158. List<int> dressitemIDList = new List<int>();
  159. List<int> propIDList = new List<int>();
  160. List<TransformData> transDataList = new List<TransformData>();
  161. DressUpBgID = 180001;
  162. MathingDressDate.bgId = 180001;
  163. MathingDressDate.actionId = 0;
  164. DressPropTransInfoDic.Clear();
  165. for (int i = 0; i < AllDressIDInfoList.Count; i++)
  166. {
  167. if(AllDressIDInfoList[i].ItemId == roleID)
  168. {
  169. //propIDList.Add(AllDressIDInfoList[i].ItemId);
  170. //transDataList.Add(AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
  171. DressPropTransInfoDic.Add(AllDressIDInfoList[i].ItemId.ToString(), AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
  172. }
  173. else
  174. {
  175. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(GetIDByString(AllDressIDInfoList[i].ItemId));
  176. if (itemCfg != null && itemCfg.itemType == ConstItemType.DRESS_UP)
  177. {
  178. if(itemCfg.subType == 19 || itemCfg.subType == 17 || itemCfg.subType == 21|| itemCfg.subType == 22)
  179. {
  180. //记录道具和位置信息
  181. //propIDList.Add(GetIDByString(AllDressIDInfoList[i].ItemId));
  182. //transDataList.Add(AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
  183. DressPropTransInfoDic.Add(AllDressIDInfoList[i].ItemId.ToString(), AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
  184. }
  185. else if (itemCfg != null && itemCfg.subType == ConstDressUpItemType.BEI_JING)
  186. {
  187. DressUpBgID = itemCfg.id;
  188. MathingDressDate.bgId = itemCfg.id;
  189. }
  190. else
  191. {
  192. dressitemIDList.Add(GetIDByString(AllDressIDInfoList[i].ItemId));
  193. }
  194. }
  195. else if (itemCfg != null && itemCfg.itemType == ConstItemType.PHOTOGRAPH)
  196. {
  197. //记录道具和位置信息
  198. //propIDList.Add(GetIDByString(AllDressIDInfoList[i].ItemId));
  199. //transDataList.Add(AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
  200. DressPropTransInfoDic.Add(AllDressIDInfoList[i].ItemId.ToString(), AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
  201. }
  202. else if(itemCfg == null)
  203. {
  204. SuitCfg actionId = SuitCfgArray.Instance.GetCfg(GetIDByString(AllDressIDInfoList[i].ItemId));
  205. if(actionId !=null)
  206. {
  207. MathingDressDate.actionId = GetIDByString(AllDressIDInfoList[i].ItemId);
  208. }
  209. }
  210. }
  211. }
  212. MathingDressDate.itemList = dressitemIDList;
  213. //DressPropIdList = propIDList;
  214. //TransformDataList = transDataList;
  215. }
  216. public TransformData AnalysisStringToTransform(string strTrans)
  217. {
  218. TransformData transData = new TransformData();
  219. string[] parts = Regex.Split(strTrans, "_");
  220. if(parts.Length > 6)
  221. {
  222. transData.position.x = float.Parse(parts[0]);
  223. transData.position.y = float.Parse(parts[1]);
  224. transData.position.z = float.Parse(parts[2]);
  225. transData.rotationZ = float.Parse(parts[3]);
  226. transData.scale.x = float.Parse(parts[4]);
  227. transData.scale.y = float.Parse(parts[5]);
  228. transData.scale.z = float.Parse(parts[6]);
  229. }
  230. return transData;
  231. }
  232. //存储道具信息
  233. public void SetTransformData()
  234. {
  235. DressPropNameList.Clear();
  236. TransformDataList.Clear();
  237. DressPropTransInfoDic.Clear();
  238. for (int i =0;i<itemGameObjs.Count;i++)
  239. {
  240. TransformData itemData = new TransformData();
  241. if (itemGameObjs[i].name == "Role")
  242. {
  243. roleTransFormData.position = itemGameObjs[i].transform.position;
  244. roleTransFormData.rotationZ = itemGameObjs[i].transform.eulerAngles.z;
  245. roleTransFormData.scale = itemGameObjs[i].transform.localScale;
  246. TransformDataList.Add(roleTransFormData);
  247. DressPropNameList.Add(itemGameObjs[i].name);
  248. }
  249. else
  250. {
  251. itemData.position = itemGameObjs[i].transform.position;
  252. itemData.rotationZ = itemGameObjs[i].transform.eulerAngles.z;
  253. itemData.scale = itemGameObjs[i].transform.localScale;
  254. TransformDataList.Add(itemData);
  255. DressPropNameList.Add(itemGameObjs[i].name);
  256. }
  257. DressPropTransInfoDic.Add(itemGameObjs[i].name, itemData);
  258. }
  259. //SetNameToIdList();
  260. }
  261. public int GetIDByString(string name)
  262. {
  263. int id = 0;
  264. //使用正则表达式分割字符串
  265. string[] parts = Regex.Split(name, "_");
  266. if(parts.Length > 0)
  267. {
  268. if(parts[0] == "Role")
  269. {
  270. return -1;
  271. }
  272. id = int.Parse(parts[0]);
  273. }
  274. return id;
  275. }
  276. public List<int> GetIDListByString(string name)
  277. {
  278. List<int> idList = new List<int>();
  279. string[] parts = Regex.Split(name, "_");
  280. foreach(string id in parts)
  281. {
  282. idList.Add(int.Parse(id));
  283. }
  284. return idList;
  285. }
  286. //将名字转换成道具id
  287. //public void SetNameToIdList()
  288. //{
  289. // //DressPropIdList.Clear();
  290. // int flog_prefix = 0;
  291. // int flog_suffix = 0;
  292. // for (int i = 0; i < DressPropNameList.Count; i++)
  293. // {
  294. // bool containsUnderscore = Regex.IsMatch(DressPropNameList[i], "_");
  295. // if(!containsUnderscore)
  296. // {
  297. // if (DressPropNameList[i] == "Role")
  298. // {
  299. // DressPropIdList.Add(roleID);
  300. // }
  301. // else if (DressPropNameList[i] == "Border")
  302. // {
  303. // if (BorderID != 0)
  304. // {
  305. // DressPropIdList.Add(BorderID);
  306. // }
  307. // }
  308. // else if (DressPropNameList[i] == "Npc")
  309. // {
  310. // if (NpcID != 0)
  311. // {
  312. // DressPropIdList.Add(NpcID);
  313. // }
  314. // }
  315. // }
  316. // else
  317. // {
  318. // // 使用正则表达式分割字符串
  319. // string[] parts = Regex.Split(DressPropNameList[i], "_");
  320. // int partID = int.Parse(parts[0]);
  321. // if(flog_prefix == int.Parse(parts[0]))
  322. // {
  323. // if((flog_suffix == 3 && int.Parse(parts[1]) == 1)|| (flog_suffix == 1 && int.Parse(parts[1]) == 3))
  324. // {
  325. // flog_prefix = 0;
  326. // flog_suffix = 0;
  327. // continue;
  328. // }
  329. // if ((flog_suffix == 2 && int.Parse(parts[1]) == 1) || (flog_suffix == 1 && int.Parse(parts[1]) == 2))
  330. // {
  331. // flog_prefix = 0;
  332. // flog_suffix = 0;
  333. // continue;
  334. // }
  335. // }
  336. // flog_prefix = int.Parse(parts[0]);
  337. // flog_suffix = int.Parse(parts[1]);
  338. // DressPropIdList.Add(partID);
  339. // }
  340. // }
  341. //}
  342. //将穿戴数据分类
  343. //public void ClassifyEquipData()
  344. //{
  345. // _equipSceneData.Clear();
  346. // PhotographDataManager.Instance.dressUpObj = new DressUpObj();
  347. // //for (int i = 0; i < MathingDressDate.itemList.Count; i++)
  348. // //{
  349. // // int itemId = MathingDressDate.itemList[i];
  350. // // if (DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(itemId, false))
  351. // // {
  352. // // if (!_equipSceneData.ContainsKey(itemId))
  353. // // {
  354. // // _equipSceneData.Add(itemId, new List<int>());
  355. // // }
  356. // // _equipSceneData[itemId].Add(itemId);
  357. // // }
  358. // //}
  359. // for(int i =0;i<DressPropIdList.Count;i++)
  360. // {
  361. // int itemId = DressPropIdList[i];
  362. // if (DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(itemId, false))
  363. // {
  364. // _equipSceneData.Add(itemId);
  365. // }
  366. // }
  367. //}
  368. public void InsertGameObjectList()
  369. {
  370. int i = 0;
  371. foreach(var item in DressPropTransInfoDic)
  372. {
  373. i++;
  374. if (item.Key == roleID)
  375. {
  376. indexRoleData = i;
  377. }
  378. }
  379. if(itemGameObjs.Count ==0)
  380. {
  381. itemGameObjs.Add(roleGameobj);
  382. }
  383. else
  384. {
  385. if (indexRoleData > itemGameObjs.Count)
  386. {
  387. itemGameObjs.Add(roleGameobj);
  388. }
  389. else
  390. {
  391. itemGameObjs.Insert(indexRoleData, roleGameobj);
  392. }
  393. }
  394. }
  395. public void SetNumToRank(int index,UI_Component4 rankCom)
  396. {
  397. int c1 = 0;
  398. int c2 = 0;
  399. if(index<=3&& index >=1)
  400. {
  401. c2 = index;
  402. }
  403. if (index > 3 && index <= 9)
  404. {
  405. c1 = 0;
  406. }
  407. else if(index >9 && index <= 50)
  408. {
  409. c1 = 1;
  410. }
  411. else
  412. {
  413. c1 = 2;
  414. }
  415. rankCom.m_c1.selectedIndex = c1;
  416. rankCom.m_c2.selectedIndex = c2;
  417. if(c1 == 0)
  418. {
  419. rankCom.m_num3.url = string.Format("ui://MatchingCompetition/{0}",index.ToString());
  420. }
  421. else if(c1 == 1)
  422. {
  423. int one = index / 10;
  424. int two = index % 10;
  425. rankCom.m_num1.url = string.Format("ui://MatchingCompetition/{0}", one.ToString());
  426. rankCom.m_num2.url = string.Format("ui://MatchingCompetition/{0}", two.ToString());
  427. }
  428. else
  429. {
  430. if (index == 0)
  431. {
  432. rankCom.m_RankText.text = "--";
  433. }
  434. else
  435. {
  436. for (int i = 11; i < JudgingRoundRewardCfgArray.Instance.dataArray.Length-1; i++)
  437. {
  438. JudgingRoundRewardCfg judgingCfg = JudgingRoundRewardCfgArray.Instance.GetCfg(i);
  439. JudgingRoundRewardCfg judgingNextCfg = JudgingRoundRewardCfgArray.Instance.GetCfg(i+1);
  440. if (index >= judgingCfg.rank && index < judgingNextCfg.rank)
  441. {
  442. rankCom.m_RankText.text = judgingNextCfg.desc;
  443. }
  444. else
  445. {
  446. rankCom.m_RankText.text = index.ToString();
  447. }
  448. }
  449. }
  450. }
  451. }
  452. public async void AddSceneItem(ItemCfg itemCfg, bool setLayer,int isLeft = 0)
  453. {
  454. Vector3 pos = Vector3.zero;
  455. DressPropIndex++;
  456. if (!string.IsNullOrEmpty(itemCfg.resLayer3))
  457. {
  458. GameObject parentGameObj3 = new GameObject(string.Format("{0}_{1}_{2}", itemCfg.id, 3,DressPropIndex++));
  459. await PhotographSceneManager.Instance.AddSceneItem(parentGameObj3, itemCfg, 3, setLayer,false,isLeft);
  460. if (setLayer)
  461. {
  462. if (parentGameObj3.transform.childCount > 0)
  463. {
  464. parentGameObj3.transform.localPosition = -parentGameObj3.transform.GetChild(0).localPosition;
  465. pos = parentGameObj3.transform.localPosition;
  466. }
  467. }
  468. }
  469. if (!string.IsNullOrEmpty(itemCfg.resLayer2))
  470. {
  471. GameObject parentGameObj2 = new GameObject(string.Format("{0}_{1}_{2}", itemCfg.id, 2,DressPropIndex++));
  472. await PhotographSceneManager.Instance.AddSceneItem(parentGameObj2, itemCfg, 2, setLayer,false, isLeft);
  473. if (setLayer)
  474. {
  475. if (parentGameObj2.transform.childCount > 0)
  476. {
  477. parentGameObj2.transform.localPosition = pos == Vector3.zero ? -parentGameObj2.transform.GetChild(0).localPosition : pos;
  478. pos = parentGameObj2.transform.localPosition;
  479. }
  480. }
  481. }
  482. if (!string.IsNullOrEmpty(itemCfg.resLayer1))
  483. {
  484. GameObject parentGameObj1 = new GameObject(string.Format("{0}_{1}_{2}", itemCfg.id, 1, DressPropIndex++));
  485. await PhotographSceneManager.Instance.AddSceneItem(parentGameObj1, itemCfg, 1, setLayer, false, isLeft);
  486. if (setLayer)
  487. {
  488. if (parentGameObj1.transform.childCount > 0)
  489. {
  490. parentGameObj1.transform.localPosition = pos == Vector3.zero ? -parentGameObj1.transform.GetChild(0).localPosition : pos;
  491. pos = parentGameObj1.transform.localPosition;
  492. }
  493. }
  494. }
  495. }
  496. public async void AddSceneItemOne(ItemCfg itemCfg, int layer,int index, int isLeft = 0, bool setLayer = true)
  497. {
  498. Vector3 pos = Vector3.zero;
  499. DressPropIndex++;
  500. GameObject parentGameObj3 = new GameObject(string.Format("{0}_{1}_{2}", itemCfg.id, layer, index));
  501. await PhotographSceneManager.Instance.AddSceneItem(parentGameObj3, itemCfg, layer, setLayer, false, isLeft);
  502. if (setLayer)
  503. {
  504. if (parentGameObj3.transform.childCount > 0)
  505. {
  506. parentGameObj3.transform.localPosition = -parentGameObj3.transform.GetChild(0).localPosition;
  507. pos = parentGameObj3.transform.localPosition;
  508. }
  509. }
  510. }
  511. public void OnClickBtnRule()
  512. {
  513. ViewManager.Show<MatchingCompetitionRuleTipsView>();
  514. }
  515. }
  516. class MatchingOneDataManager : SingletonBase<MatchingOneDataManager>
  517. {
  518. //其他玩家信息用于展示
  519. public MatchingPhotoWorksData OneRoleInfo = new MatchingPhotoWorksData();
  520. //人物位置信息
  521. public TransformData roleTransFormData = new TransformData();
  522. public GameObject roleGameobj;
  523. public string roleID = "Role";
  524. //*********************搭配数据*********************************
  525. //需要传输的数据:MathingDressDate,DressUpBgID,DressPropIdList,TransformDataList,
  526. public DressUpData MathingDressDate = DressUpData.CreateDefault();
  527. public int DressUpBgID = 0;
  528. //*****这两个id放列表的最后面
  529. //边框id
  530. public int BorderID = 0;
  531. //NpcId
  532. public int NpcID = 0;
  533. //道具数据,一一对应
  534. //道具id
  535. //public List<int> DressPropIdList = new List<int>();
  536. //道具位置信息
  537. public List<TransformData> TransformDataList = new List<TransformData>();
  538. //道具索引
  539. public int DressPropIndex = 0;
  540. //道具索引字典
  541. public Dictionary<string, TransformData> DressPropTransInfoDic = new Dictionary<string, TransformData>();
  542. public List<GameObject> itemGameObjs = new List<GameObject>();
  543. //***************************************************************
  544. //解析后台获取的信息
  545. public void AnalysisInfoToList()
  546. {
  547. List<int> dressitemIDList = new List<int>();
  548. List<int> propIDList = new List<int>();
  549. List<TransformData> transDataList = new List<TransformData>();
  550. for (int i = 0; i < OneRoleInfo.JudgingInfo.CollocationInfoList.Count; i++)
  551. {
  552. CollocationInfo colloctItemInfo = OneRoleInfo.JudgingInfo.CollocationInfoList[i];
  553. if (colloctItemInfo.ItemId == roleID)
  554. {
  555. //propIDList.Add(colloctItemInfo.ItemId);
  556. //transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
  557. DressPropTransInfoDic.Add(colloctItemInfo.ItemId, MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
  558. }
  559. else
  560. {
  561. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(MatchingCompetitionDataManager.Instance.GetIDByString( colloctItemInfo.ItemId));
  562. if (itemCfg != null && itemCfg.itemType == ConstItemType.DRESS_UP)
  563. {
  564. if (itemCfg.subType == 19 || itemCfg.subType == 17 || itemCfg.subType == 21 || itemCfg.subType == 22)
  565. {
  566. //记录道具和位置信息
  567. //propIDList.Add(colloctItemInfo.ItemId);
  568. //transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
  569. DressPropTransInfoDic.Add(colloctItemInfo.ItemId, MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
  570. }
  571. else if (itemCfg != null && itemCfg.subType == ConstDressUpItemType.BEI_JING)
  572. {
  573. DressUpBgID = itemCfg.id;
  574. }
  575. else
  576. {
  577. dressitemIDList.Add(MatchingCompetitionDataManager.Instance.GetIDByString(colloctItemInfo.ItemId));
  578. }
  579. }
  580. else if (itemCfg != null && itemCfg.itemType == ConstItemType.PHOTOGRAPH)
  581. {
  582. //记录道具和位置信息
  583. //propIDList.Add(colloctItemInfo.ItemId);
  584. //transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
  585. DressPropTransInfoDic.Add(colloctItemInfo.ItemId, MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
  586. }
  587. }
  588. }
  589. MathingDressDate.itemList = dressitemIDList;
  590. MathingDressDate.actionId = OneRoleInfo.JudgingInfo.ActionId;
  591. //DressPropIdList = propIDList;
  592. //TransformDataList = transDataList;
  593. DressUpBgID = OneRoleInfo.JudgingInfo.BagId;
  594. }
  595. public void InsertGameObjectList()
  596. {
  597. int indexRoleData = 0;
  598. int i = 0;
  599. foreach (var item in DressPropTransInfoDic)
  600. {
  601. i++;
  602. if (item.Key == roleID)
  603. {
  604. indexRoleData = i;
  605. }
  606. }
  607. if (itemGameObjs.Count == 0)
  608. {
  609. itemGameObjs.Add(roleGameobj);
  610. }
  611. else
  612. {
  613. if (indexRoleData > itemGameObjs.Count)
  614. {
  615. itemGameObjs.Add(roleGameobj);
  616. }
  617. else
  618. {
  619. itemGameObjs.Insert(indexRoleData, roleGameobj);
  620. }
  621. }
  622. }
  623. }
  624. }