| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 | 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 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<int> DressPropIdList = new List<int>();        //道具位置信息        //public List<TransformData> TransformDataList = new List<TransformData>();        //道具索引        public int DressPropIndex = 0;        //道具索引字典        public Dictionary<string, TransformData> DressPropTransInfoDic = new Dictionary<string, 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>();            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<MatchingRightDataManager>    {        //其他玩家信息用于展示        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<int> DressPropIdList = new List<int>();        //道具位置信息       // public List<TransformData> TransformDataList = new List<TransformData>();        //道具索引        public int DressPropIndex = 0;        //道具索引字典        public Dictionary<string, TransformData> DressPropTransInfoDic = new Dictionary<string, 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>();            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);                }            }        }    }}
 |