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 { //其他玩家信息用于展示 public MatchingPhotoWorksData LeftRoleInfo = new MatchingPhotoWorksData(); //人物位置信息 public TransformData roleTransFormData = new TransformData(); public GameObject roleGameobj; public string roleID = "Role"; //*********************搭配数据********************************* //需要传输的数据: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 DressPropIdList = new List(); //道具位置信息 //public List TransformDataList = new List(); //道具索引 public int DressPropIndex = 0; //道具索引字典 public Dictionary DressPropTransInfoDic = new Dictionary(); public List itemGameObjs = new List(); //*************************************************************** //解析后台获取的信息 public void AnalysisInfoToList() { List dressitemIDList = new List(); List propIDList = new List(); List transDataList = new List(); DressPropTransInfoDic.Clear(); for (int i = 0; i < LeftRoleInfo.JudgingInfo.CollocationInfoList.Count; i++) { CollocationInfo colloctItemInfo = LeftRoleInfo.JudgingInfo.CollocationInfoList[i]; if (colloctItemInfo.ItemId == roleID) { //propIDList.Add(colloctItemInfo.ItemId); //transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition)); DressPropTransInfoDic.Add(colloctItemInfo.ItemId, MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition)); } else { ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(MatchingCompetitionDataManager.Instance.GetIDByString( colloctItemInfo.ItemId)); if (itemCfg != null && itemCfg.itemType == ConstItemType.DRESS_UP) { if (itemCfg.subType == 19 || itemCfg.subType == 17 || itemCfg.subType == 21 || itemCfg.subType == 22) { //记录道具和位置信息 //propIDList.Add(colloctItemInfo.ItemId); //transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition)); DressPropTransInfoDic.Add(colloctItemInfo.ItemId, MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition)); } else if (itemCfg != null && itemCfg.subType == ConstDressUpItemType.BEI_JING) { DressUpBgID = itemCfg.id; } else { dressitemIDList.Add(MatchingCompetitionDataManager.Instance.GetIDByString(colloctItemInfo.ItemId)); } } else if (itemCfg != null && itemCfg.itemType == ConstItemType.PHOTOGRAPH) { //记录道具和位置信息 //propIDList.Add(colloctItemInfo.ItemId); //transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition)); DressPropTransInfoDic.Add(colloctItemInfo.ItemId, MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition)); } } } MathingDressDate.itemList = dressitemIDList; MathingDressDate.actionId = LeftRoleInfo.JudgingInfo.ActionId; //DressPropIdList = propIDList; //TransformDataList = transDataList; DressUpBgID = LeftRoleInfo.JudgingInfo.BagId; } public void InsertGameObjectList() { int indexRoleData = 0; int i = 0; foreach (var item in DressPropTransInfoDic) { i++; if (item.Key == 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 { //其他玩家信息用于展示 public MatchingPhotoWorksData RightRoleInfo = new MatchingPhotoWorksData(); //人物位置信息 public TransformData roleTransFormData = new TransformData(); public GameObject roleGameobj; public string roleID = "Role"; //*********************搭配数据********************************* //需要传输的数据: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 DressPropIdList = new List(); //道具位置信息 // public List TransformDataList = new List(); //道具索引 public int DressPropIndex = 0; //道具索引字典 public Dictionary DressPropTransInfoDic = new Dictionary(); public List itemGameObjs = new List(); //*************************************************************** //解析后台获取的信息 public void AnalysisInfoToList() { List dressitemIDList = new List(); List propIDList = new List(); List transDataList = new List(); DressPropTransInfoDic.Clear(); for (int i = 0; i < RightRoleInfo.JudgingInfo.CollocationInfoList.Count; i++) { CollocationInfo colloctItemInfo = RightRoleInfo.JudgingInfo.CollocationInfoList[i]; if (colloctItemInfo.ItemId == roleID) { //propIDList.Add(colloctItemInfo.ItemId); //transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition)); DressPropTransInfoDic.Add(colloctItemInfo.ItemId, MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition)); } else { ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(MatchingCompetitionDataManager.Instance.GetIDByString(colloctItemInfo.ItemId)); if (itemCfg != null && itemCfg.itemType == ConstItemType.DRESS_UP) { if (itemCfg.subType == 19 || itemCfg.subType == 17 || itemCfg.subType == 21 || itemCfg.subType == 22) { //记录道具和位置信息 //propIDList.Add(colloctItemInfo.ItemId); //transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition)); DressPropTransInfoDic.Add(colloctItemInfo.ItemId, MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition)); } else if (itemCfg != null && itemCfg.subType == ConstDressUpItemType.BEI_JING) { DressUpBgID = itemCfg.id; } else { dressitemIDList.Add(MatchingCompetitionDataManager.Instance.GetIDByString(colloctItemInfo.ItemId)); } } else if (itemCfg != null && itemCfg.itemType == ConstItemType.PHOTOGRAPH) { //记录道具和位置信息 //propIDList.Add(colloctItemInfo.ItemId); //transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition)); DressPropTransInfoDic.Add(colloctItemInfo.ItemId, MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition)); } } } MathingDressDate.itemList = dressitemIDList; MathingDressDate.actionId = RightRoleInfo.JudgingInfo.ActionId; //DressPropIdList = propIDList; //TransformDataList = transDataList; DressUpBgID = RightRoleInfo.JudgingInfo.BagId; } public void InsertGameObjectList() { int indexRoleData = 0; int i = 0; foreach (var item in DressPropTransInfoDic) { i++; if (item.Key == roleID) { indexRoleData = i; } } if (itemGameObjs.Count == 0) { itemGameObjs.Add(roleGameobj); } else { if (indexRoleData > itemGameObjs.Count) { itemGameObjs.Add(roleGameobj); } else { itemGameObjs.Insert(indexRoleData, roleGameobj); } } } } }