123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220 |
- using ET;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Text.RegularExpressions;
- using UnityEngine;
- using Live2D.Cubism.Rendering;
- using FairyGUI;
- using UI.MatchingCompetition;
- namespace GFGGame
- {
- class MatchingLeftDataManager : SingletonBase<MatchingLeftDataManager>
- {
- //其他玩家信息用于展示
- public MatchingPhotoWorksData LeftRoleInfo = new MatchingPhotoWorksData();
- //人物位置信息
- public TransformData roleTransFormData = new TransformData();
- public GameObject roleGameobj;
- public int roleID = -1;
- //*********************搭配数据*********************************
- //需要传输的数据:MathingDressDate,DressUpBgID,DressPropIdList,TransformDataList,
- public DressUpData MathingDressDate = DressUpData.CreateDefault();
- public int DressUpBgID = 0;
- //*****这两个id放列表的最后面
- //边框id
- public int BorderID = 0;
- //NpcId
- public int NpcID = 0;
- //道具数据,一一对应
- //道具id
- public List<int> DressPropIdList = new List<int>();
- //道具位置信息
- public List<TransformData> TransformDataList = new List<TransformData>();
- public List<GameObject> itemGameObjs = new List<GameObject>();
- //***************************************************************
- //解析后台获取的信息
- public void AnalysisInfoToList()
- {
- List<int> dressitemIDList = new List<int>();
- List<int> propIDList = new List<int>();
- List<TransformData> transDataList = new List<TransformData>();
- for (int i = 0; i < LeftRoleInfo.JudgingInfo.CollocationInfoList.Count; i++)
- {
- if (LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId == roleID)
- {
- propIDList.Add(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
- transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ClientPosition));
- }
- else
- {
- ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
- if (itemCfg != null && itemCfg.itemType == ConstItemType.DRESS_UP)
- {
- if (itemCfg.subType == 19 || itemCfg.subType == 17 || itemCfg.subType == 21 || itemCfg.subType == 22)
- {
- //记录道具和位置信息
- propIDList.Add(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
- transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ClientPosition));
- if (itemCfg.resLayer2 == "t" || itemCfg.resLayer3 == "t")
- {
- propIDList.Add(-3);
- transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ClientPosition));
- }
- }
- else if (itemCfg != null && itemCfg.subType == ConstDressUpItemType.BEI_JING)
- {
- DressUpBgID = itemCfg.id;
- }
- else
- {
- dressitemIDList.Add(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
- }
- }
- else if (itemCfg != null && itemCfg.itemType == ConstItemType.PHOTOGRAPH)
- {
- //记录道具和位置信息
- propIDList.Add(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
- transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ClientPosition));
- }
- }
- }
- MathingDressDate.itemList = dressitemIDList;
- MathingDressDate.actionId = LeftRoleInfo.JudgingInfo.ActionId;
- DressPropIdList = propIDList;
- TransformDataList = transDataList;
- DressUpBgID = LeftRoleInfo.JudgingInfo.BagId;
- }
- public void InsertGameObjectList()
- {
- int indexRoleData = 0;
- for (int i = 0; i < DressPropIdList.Count; i++)
- {
- if (DressPropIdList[i] == roleID)
- {
- indexRoleData = i;
- }
- }
- if (itemGameObjs.Count == 0)
- {
- itemGameObjs.Add(roleGameobj);
- }
- else
- {
- if(indexRoleData > itemGameObjs.Count)
- {
- itemGameObjs.Add(roleGameobj);
- }
- else
- {
- itemGameObjs.Insert(indexRoleData, roleGameobj);
- }
- }
- }
- }
- class MatchingRightDataManager : SingletonBase<MatchingRightDataManager>
- {
- //其他玩家信息用于展示
- public MatchingPhotoWorksData RightRoleInfo = new MatchingPhotoWorksData();
- //人物位置信息
- public TransformData roleTransFormData = new TransformData();
- public GameObject roleGameobj;
- public int roleID = -1;
- //*********************搭配数据*********************************
- //需要传输的数据:MathingDressDate,DressUpBgID,DressPropIdList,TransformDataList,
- public DressUpData MathingDressDate = DressUpData.CreateDefault();
- public int DressUpBgID = 0;
- //*****这两个id放列表的最后面
- //边框id
- public int BorderID = 0;
- //NpcId
- public int NpcID = 0;
- //道具数据,一一对应
- //道具id
- public List<int> DressPropIdList = new List<int>();
- //道具位置信息
- public List<TransformData> TransformDataList = new List<TransformData>();
- public List<GameObject> itemGameObjs = new List<GameObject>();
- //***************************************************************
- //解析后台获取的信息
- public void AnalysisInfoToList()
- {
- List<int> dressitemIDList = new List<int>();
- List<int> propIDList = new List<int>();
- List<TransformData> transDataList = new List<TransformData>();
- for (int i = 0; i < RightRoleInfo.JudgingInfo.CollocationInfoList.Count; i++)
- {
- if (RightRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId == roleID)
- {
- propIDList.Add(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
- transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ClientPosition));
- }
- else
- {
- ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
- if (itemCfg != null && itemCfg.itemType == ConstItemType.DRESS_UP)
- {
- if (itemCfg.subType == 19 || itemCfg.subType == 17 || itemCfg.subType == 21 || itemCfg.subType == 22)
- {
- //记录道具和位置信息
- propIDList.Add(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
- transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ClientPosition));
- if ( itemCfg.resLayer2 == "t" || itemCfg.resLayer3 == "t")
- {
- propIDList.Add(-3);
- transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ClientPosition));
- }
- }
- else if (itemCfg != null && itemCfg.subType == ConstDressUpItemType.BEI_JING)
- {
- DressUpBgID = itemCfg.id;
- }
- else
- {
- dressitemIDList.Add(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
- }
- }
- else if (itemCfg != null && itemCfg.itemType == ConstItemType.PHOTOGRAPH)
- {
- //记录道具和位置信息
- propIDList.Add(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
- transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ClientPosition));
- }
- }
- }
- MathingDressDate.itemList = dressitemIDList;
- MathingDressDate.actionId = RightRoleInfo.JudgingInfo.ActionId;
- DressPropIdList = propIDList;
- TransformDataList = transDataList;
- DressUpBgID = RightRoleInfo.JudgingInfo.BagId;
- }
- public void InsertGameObjectList()
- {
- int indexRoleData = 0;
- for (int i = 0; i < DressPropIdList.Count; i++)
- {
- if (DressPropIdList[i] == roleID)
- {
- indexRoleData = i;
- }
- }
- if (itemGameObjs.Count == 0)
- {
- itemGameObjs.Add(roleGameobj);
- }
- else
- {
- if (indexRoleData > itemGameObjs.Count)
- {
- itemGameObjs.Add(roleGameobj);
- }
- else
- {
- itemGameObjs.Insert(indexRoleData, roleGameobj);
- }
- }
- }
- }
- }
|