|
@@ -1,4 +1,5 @@
|
|
-using ET;
|
|
|
|
|
|
+
|
|
|
|
+using ET;
|
|
using System;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
@@ -7,6 +8,7 @@ using UnityEngine;
|
|
using Live2D.Cubism.Rendering;
|
|
using Live2D.Cubism.Rendering;
|
|
using FairyGUI;
|
|
using FairyGUI;
|
|
using UI.MatchingCompetition;
|
|
using UI.MatchingCompetition;
|
|
|
|
+using System.IO;
|
|
|
|
|
|
namespace GFGGame
|
|
namespace GFGGame
|
|
{
|
|
{
|
|
@@ -19,7 +21,7 @@ namespace GFGGame
|
|
//人物位置信息
|
|
//人物位置信息
|
|
public TransformData roleTransFormData = new TransformData();
|
|
public TransformData roleTransFormData = new TransformData();
|
|
public GameObject roleGameobj;
|
|
public GameObject roleGameobj;
|
|
- public int roleID = -1;
|
|
|
|
|
|
+ public string roleID = "Role";
|
|
//*********************搭配数据*********************************
|
|
//*********************搭配数据*********************************
|
|
//需要传输的数据:MathingDressDate,DressUpBgID,DressPropIdList,TransformDataList,
|
|
//需要传输的数据:MathingDressDate,DressUpBgID,DressPropIdList,TransformDataList,
|
|
public DressUpData MathingDressDate = DressUpData.CreateDefault();
|
|
public DressUpData MathingDressDate = DressUpData.CreateDefault();
|
|
@@ -34,7 +36,11 @@ namespace GFGGame
|
|
//场景名字,自己搭配的数据
|
|
//场景名字,自己搭配的数据
|
|
public List<string> DressPropNameList = new List<string>();
|
|
public List<string> DressPropNameList = new List<string>();
|
|
//道具id
|
|
//道具id
|
|
- public List<int> DressPropIdList = new List<int>();
|
|
|
|
|
|
+ //public List<int> DressPropIdList = new List<int>();
|
|
|
|
+ //道具索引
|
|
|
|
+ public int DressPropIndex = 0;
|
|
|
|
+ //道具索引字典
|
|
|
|
+ public Dictionary<string, TransformData> DressPropTransInfoDic = new Dictionary<string, TransformData>();
|
|
//道具位置信息
|
|
//道具位置信息
|
|
public List<TransformData> TransformDataList = new List<TransformData>();
|
|
public List<TransformData> TransformDataList = new List<TransformData>();
|
|
public List<GameObject> itemGameObjs = new List<GameObject>();
|
|
public List<GameObject> itemGameObjs = new List<GameObject>();
|
|
@@ -64,7 +70,11 @@ namespace GFGGame
|
|
public NTexture MyNtextture;
|
|
public NTexture MyNtextture;
|
|
public byte[] MyBytes;
|
|
public byte[] MyBytes;
|
|
//本期排行榜数据
|
|
//本期排行榜数据
|
|
- public List<MatchingPhotoWorksData> _currentRankList = new List<MatchingPhotoWorksData>();
|
|
|
|
|
|
+ public List<CurRanMatchingPhotoWorksData> _currentRankList = new List<CurRanMatchingPhotoWorksData>();
|
|
|
|
+ //本期排行榜数据--协程锁变量
|
|
|
|
+ public bool IsWork = false;
|
|
|
|
+ //本期排行榜数据--协程消息队列
|
|
|
|
+ public Queue<int> _coroutineQueue = new Queue<int>();
|
|
//往期作品集
|
|
//往期作品集
|
|
public List<MatchingWorksData> _BeforeWorksList = new List<MatchingWorksData>();
|
|
public List<MatchingWorksData> _BeforeWorksList = new List<MatchingWorksData>();
|
|
//往期排行榜数据
|
|
//往期排行榜数据
|
|
@@ -116,28 +126,40 @@ namespace GFGGame
|
|
foreach(var item in MathingDressDate.itemList)
|
|
foreach(var item in MathingDressDate.itemList)
|
|
{
|
|
{
|
|
CollocationInfo itemInfo = new CollocationInfo();
|
|
CollocationInfo itemInfo = new CollocationInfo();
|
|
- itemInfo.ItemId = item;
|
|
|
|
|
|
+ itemInfo.ItemId = item.ToString();
|
|
itemInfo.ClientPosition = "";
|
|
itemInfo.ClientPosition = "";
|
|
AllDressIDInfoList.Add(itemInfo);
|
|
AllDressIDInfoList.Add(itemInfo);
|
|
}
|
|
}
|
|
- for(int i = 0;i< DressPropIdList.Count;i++)
|
|
|
|
|
|
+ foreach (var item in DressPropTransInfoDic)
|
|
{
|
|
{
|
|
CollocationInfo itemInfo = new CollocationInfo();
|
|
CollocationInfo itemInfo = new CollocationInfo();
|
|
- itemInfo.ItemId = DressPropIdList[i];
|
|
|
|
- string transStr = TransformDataList[i].position.x.ToString()+"_" + TransformDataList[i].position.y.ToString() + "_"
|
|
|
|
- + TransformDataList[i].position.z.ToString()
|
|
|
|
- + "_" + TransformDataList[i].rotationZ.ToString()
|
|
|
|
- + "_" + TransformDataList[i].scale.x.ToString() + "_" +
|
|
|
|
- TransformDataList[i].scale.y.ToString() + "_" + TransformDataList[i].scale.z.ToString();
|
|
|
|
|
|
+ itemInfo.ItemId = item.Key;
|
|
|
|
+ string transStr = item.Value.position.x.ToString() + "_" + item.Value.position.y.ToString() + "_"
|
|
|
|
+ + item.Value.position.z.ToString()
|
|
|
|
+ + "_" + item.Value.rotationZ.ToString()
|
|
|
|
+ + "_" + item.Value.scale.x.ToString() + "_" +
|
|
|
|
+ item.Value.scale.y.ToString() + "_" + item.Value.scale.z.ToString();
|
|
itemInfo.ClientPosition = transStr;
|
|
itemInfo.ClientPosition = transStr;
|
|
AllDressIDInfoList.Add(itemInfo);
|
|
AllDressIDInfoList.Add(itemInfo);
|
|
}
|
|
}
|
|
|
|
+ //for(int i = 0;i< DressPropIdList.Count;i++)
|
|
|
|
+ //{
|
|
|
|
+ // CollocationInfo itemInfo = new CollocationInfo();
|
|
|
|
+ // itemInfo.ItemId = DressPropIdList[i];
|
|
|
|
+ // string transStr = TransformDataList[i].position.x.ToString()+"_" + TransformDataList[i].position.y.ToString() + "_"
|
|
|
|
+ // + TransformDataList[i].position.z.ToString()
|
|
|
|
+ // + "_" + TransformDataList[i].rotationZ.ToString()
|
|
|
|
+ // + "_" + TransformDataList[i].scale.x.ToString() + "_" +
|
|
|
|
+ // TransformDataList[i].scale.y.ToString() + "_" + TransformDataList[i].scale.z.ToString();
|
|
|
|
+ // itemInfo.ClientPosition = transStr;
|
|
|
|
+ // AllDressIDInfoList.Add(itemInfo);
|
|
|
|
+ //}
|
|
CollocationInfo itemBgInfo = new CollocationInfo();
|
|
CollocationInfo itemBgInfo = new CollocationInfo();
|
|
- itemBgInfo.ItemId = MatchingCompetitionDataManager.Instance.DressUpBgID;
|
|
|
|
|
|
+ itemBgInfo.ItemId = MatchingCompetitionDataManager.Instance.DressUpBgID.ToString();
|
|
itemBgInfo.ClientPosition = "";
|
|
itemBgInfo.ClientPosition = "";
|
|
AllDressIDInfoList.Add(itemBgInfo);
|
|
AllDressIDInfoList.Add(itemBgInfo);
|
|
CollocationInfo itemActionInfo = new CollocationInfo();
|
|
CollocationInfo itemActionInfo = new CollocationInfo();
|
|
- itemActionInfo.ItemId = MatchingCompetitionDataManager.Instance.MathingDressDate.actionId;
|
|
|
|
|
|
+ itemActionInfo.ItemId = MatchingCompetitionDataManager.Instance.MathingDressDate.actionId.ToString();
|
|
itemActionInfo.ClientPosition = "";
|
|
itemActionInfo.ClientPosition = "";
|
|
AllDressIDInfoList.Add(itemActionInfo);
|
|
AllDressIDInfoList.Add(itemActionInfo);
|
|
}
|
|
}
|
|
@@ -147,59 +169,72 @@ namespace GFGGame
|
|
List<int> dressitemIDList = new List<int>();
|
|
List<int> dressitemIDList = new List<int>();
|
|
List<int> propIDList = new List<int>();
|
|
List<int> propIDList = new List<int>();
|
|
List<TransformData> transDataList = new List<TransformData>();
|
|
List<TransformData> transDataList = new List<TransformData>();
|
|
- DressUpBgID = 0;
|
|
|
|
|
|
+ DressUpBgID = 180001;
|
|
|
|
+ MathingDressDate.bgId = 180001;
|
|
MathingDressDate.actionId = 0;
|
|
MathingDressDate.actionId = 0;
|
|
|
|
+ DressPropTransInfoDic.Clear();
|
|
for (int i = 0; i < AllDressIDInfoList.Count; i++)
|
|
for (int i = 0; i < AllDressIDInfoList.Count; i++)
|
|
{
|
|
{
|
|
if(AllDressIDInfoList[i].ItemId == roleID)
|
|
if(AllDressIDInfoList[i].ItemId == roleID)
|
|
{
|
|
{
|
|
- propIDList.Add(AllDressIDInfoList[i].ItemId);
|
|
|
|
- transDataList.Add(AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
|
|
|
|
|
|
+ //propIDList.Add(AllDressIDInfoList[i].ItemId);
|
|
|
|
+ //transDataList.Add(AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
|
|
|
|
+ if (!DressPropTransInfoDic.ContainsKey(AllDressIDInfoList[i].ItemId))
|
|
|
|
+ {
|
|
|
|
+ DressPropTransInfoDic.Add(AllDressIDInfoList[i].ItemId.ToString(), AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(AllDressIDInfoList[i].ItemId);
|
|
|
|
|
|
+ ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(GetIDByString(AllDressIDInfoList[i].ItemId));
|
|
if (itemCfg != null && itemCfg.itemType == ConstItemType.DRESS_UP)
|
|
if (itemCfg != null && itemCfg.itemType == ConstItemType.DRESS_UP)
|
|
{
|
|
{
|
|
if(itemCfg.subType == 19 || itemCfg.subType == 17 || itemCfg.subType == 21|| itemCfg.subType == 22)
|
|
if(itemCfg.subType == 19 || itemCfg.subType == 17 || itemCfg.subType == 21|| itemCfg.subType == 22)
|
|
{
|
|
{
|
|
//记录道具和位置信息
|
|
//记录道具和位置信息
|
|
- propIDList.Add(AllDressIDInfoList[i].ItemId);
|
|
|
|
- transDataList.Add(AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
|
|
|
|
- if (itemCfg.resLayer2 == "t" || itemCfg.resLayer3 == "t")
|
|
|
|
|
|
+ //propIDList.Add(GetIDByString(AllDressIDInfoList[i].ItemId));
|
|
|
|
+ //transDataList.Add(AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
|
|
|
|
+ if(GetIDListByString(AllDressIDInfoList[i].ItemId).Count > 1)
|
|
{
|
|
{
|
|
- propIDList.Add(-3);
|
|
|
|
- transDataList.Add(AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
|
|
|
|
- }
|
|
|
|
|
|
+ if (!DressPropTransInfoDic.ContainsKey(AllDressIDInfoList[i].ItemId))
|
|
|
|
+ {
|
|
|
|
+ DressPropTransInfoDic.Add(AllDressIDInfoList[i].ItemId.ToString(), AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else if (itemCfg != null && itemCfg.subType == ConstDressUpItemType.BEI_JING)
|
|
else if (itemCfg != null && itemCfg.subType == ConstDressUpItemType.BEI_JING)
|
|
{
|
|
{
|
|
DressUpBgID = itemCfg.id;
|
|
DressUpBgID = itemCfg.id;
|
|
|
|
+ MathingDressDate.bgId = itemCfg.id;
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- dressitemIDList.Add(AllDressIDInfoList[i].ItemId);
|
|
|
|
|
|
+ dressitemIDList.Add(GetIDByString(AllDressIDInfoList[i].ItemId));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (itemCfg != null && itemCfg.itemType == ConstItemType.PHOTOGRAPH)
|
|
else if (itemCfg != null && itemCfg.itemType == ConstItemType.PHOTOGRAPH)
|
|
{
|
|
{
|
|
//记录道具和位置信息
|
|
//记录道具和位置信息
|
|
- propIDList.Add(AllDressIDInfoList[i].ItemId);
|
|
|
|
- transDataList.Add(AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
|
|
|
|
|
|
+ //propIDList.Add(GetIDByString(AllDressIDInfoList[i].ItemId));
|
|
|
|
+ //transDataList.Add(AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
|
|
|
|
+ if (!DressPropTransInfoDic.ContainsKey(AllDressIDInfoList[i].ItemId))
|
|
|
|
+ {
|
|
|
|
+ DressPropTransInfoDic.Add(AllDressIDInfoList[i].ItemId.ToString(), AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else if(itemCfg == null)
|
|
else if(itemCfg == null)
|
|
{
|
|
{
|
|
- SuitCfg actionId = SuitCfgArray.Instance.GetCfg(AllDressIDInfoList[i].ItemId);
|
|
|
|
|
|
+ SuitCfg actionId = SuitCfgArray.Instance.GetCfg(GetIDByString(AllDressIDInfoList[i].ItemId));
|
|
if(actionId !=null)
|
|
if(actionId !=null)
|
|
{
|
|
{
|
|
- MathingDressDate.actionId = AllDressIDInfoList[i].ItemId;
|
|
|
|
|
|
+ MathingDressDate.actionId = GetIDByString(AllDressIDInfoList[i].ItemId);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
MathingDressDate.itemList = dressitemIDList;
|
|
MathingDressDate.itemList = dressitemIDList;
|
|
- DressPropIdList = propIDList;
|
|
|
|
- TransformDataList = transDataList;
|
|
|
|
|
|
+ //DressPropIdList = propIDList;
|
|
|
|
+ //TransformDataList = transDataList;
|
|
}
|
|
}
|
|
public TransformData AnalysisStringToTransform(string strTrans)
|
|
public TransformData AnalysisStringToTransform(string strTrans)
|
|
{
|
|
{
|
|
@@ -222,78 +257,160 @@ namespace GFGGame
|
|
{
|
|
{
|
|
DressPropNameList.Clear();
|
|
DressPropNameList.Clear();
|
|
TransformDataList.Clear();
|
|
TransformDataList.Clear();
|
|
|
|
+ DressPropTransInfoDic.Clear();
|
|
for (int i =0;i<itemGameObjs.Count;i++)
|
|
for (int i =0;i<itemGameObjs.Count;i++)
|
|
- {
|
|
|
|
- if(itemGameObjs[i].name == "Role")
|
|
|
|
|
|
+ {
|
|
|
|
+ TransformData itemData = new TransformData();
|
|
|
|
+ if (itemGameObjs[i].name == "Role")
|
|
{
|
|
{
|
|
- TransformData itemData = new TransformData();
|
|
|
|
roleTransFormData.position = itemGameObjs[i].transform.position;
|
|
roleTransFormData.position = itemGameObjs[i].transform.position;
|
|
roleTransFormData.rotationZ = itemGameObjs[i].transform.eulerAngles.z;
|
|
roleTransFormData.rotationZ = itemGameObjs[i].transform.eulerAngles.z;
|
|
roleTransFormData.scale = itemGameObjs[i].transform.localScale;
|
|
roleTransFormData.scale = itemGameObjs[i].transform.localScale;
|
|
TransformDataList.Add(roleTransFormData);
|
|
TransformDataList.Add(roleTransFormData);
|
|
DressPropNameList.Add(itemGameObjs[i].name);
|
|
DressPropNameList.Add(itemGameObjs[i].name);
|
|
|
|
+ if (!DressPropTransInfoDic.ContainsKey(itemGameObjs[i].name))
|
|
|
|
+ {
|
|
|
|
+ DressPropTransInfoDic.Add(itemGameObjs[i].name, roleTransFormData);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else if (itemGameObjs[i].name == "Border")
|
|
|
|
+ {
|
|
|
|
+ itemData.position = itemGameObjs[i].transform.position;
|
|
|
|
+ itemData.rotationZ = itemGameObjs[i].transform.eulerAngles.z;
|
|
|
|
+ itemData.scale = itemGameObjs[i].transform.localScale;
|
|
|
|
+ TransformDataList.Add(roleTransFormData);
|
|
|
|
+ DressPropNameList.Add(itemGameObjs[i].name);
|
|
|
|
+ if (!DressPropTransInfoDic.ContainsKey(itemGameObjs[i].name))
|
|
|
|
+ {
|
|
|
|
+ DressPropTransInfoDic.Add(BorderID.ToString(), itemData);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else if (itemGameObjs[i].name == "Npc")
|
|
|
|
+ {
|
|
|
|
+ itemData.position = itemGameObjs[i].transform.position;
|
|
|
|
+ itemData.rotationZ = itemGameObjs[i].transform.eulerAngles.z;
|
|
|
|
+ itemData.scale = itemGameObjs[i].transform.localScale;
|
|
|
|
+ TransformDataList.Add(roleTransFormData);
|
|
|
|
+ DressPropNameList.Add(itemGameObjs[i].name);
|
|
|
|
+ if (!DressPropTransInfoDic.ContainsKey(itemGameObjs[i].name))
|
|
|
|
+ {
|
|
|
|
+ DressPropTransInfoDic.Add(NpcID.ToString(), itemData);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- TransformData itemData = new TransformData();
|
|
|
|
itemData.position = itemGameObjs[i].transform.position;
|
|
itemData.position = itemGameObjs[i].transform.position;
|
|
itemData.rotationZ = itemGameObjs[i].transform.eulerAngles.z;
|
|
itemData.rotationZ = itemGameObjs[i].transform.eulerAngles.z;
|
|
itemData.scale = itemGameObjs[i].transform.localScale;
|
|
itemData.scale = itemGameObjs[i].transform.localScale;
|
|
TransformDataList.Add(itemData);
|
|
TransformDataList.Add(itemData);
|
|
DressPropNameList.Add(itemGameObjs[i].name);
|
|
DressPropNameList.Add(itemGameObjs[i].name);
|
|
|
|
+ if(!DressPropTransInfoDic.ContainsKey(itemGameObjs[i].name))
|
|
|
|
+ {
|
|
|
|
+ DressPropTransInfoDic.Add(itemGameObjs[i].name, itemData);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
- SetNameToIdList();
|
|
|
|
|
|
+ //SetNameToIdList();
|
|
}
|
|
}
|
|
- //将名字转换成道具id
|
|
|
|
- public void SetNameToIdList()
|
|
|
|
|
|
+
|
|
|
|
+ public int GetIDByString(string name)
|
|
{
|
|
{
|
|
- DressPropIdList.Clear();
|
|
|
|
- int flog_prefix = 0;
|
|
|
|
- int flog_suffix = 0;
|
|
|
|
- for (int i = 0; i < DressPropNameList.Count; i++)
|
|
|
|
|
|
+ int id = 0;
|
|
|
|
+ //使用正则表达式分割字符串
|
|
|
|
+ string[] parts = Regex.Split(name, "_");
|
|
|
|
+ if (parts.Length > 0)
|
|
{
|
|
{
|
|
- bool containsUnderscore = Regex.IsMatch(DressPropNameList[i], "_");
|
|
|
|
- if(!containsUnderscore)
|
|
|
|
|
|
+ string vl = parts[0];
|
|
|
|
+ bool isNumeric = int.TryParse(vl, out _);
|
|
|
|
+ if (vl == "Role")
|
|
{
|
|
{
|
|
- if (DressPropNameList[i] == "Role")
|
|
|
|
- {
|
|
|
|
- DressPropIdList.Add(roleID);
|
|
|
|
- }
|
|
|
|
- else if (DressPropNameList[i] == "Border")
|
|
|
|
- {
|
|
|
|
- if (BorderID != 0)
|
|
|
|
- {
|
|
|
|
- DressPropIdList.Add(BorderID);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else if (DressPropNameList[i] == "Npc")
|
|
|
|
- {
|
|
|
|
- if (NpcID != 0)
|
|
|
|
- {
|
|
|
|
- DressPropIdList.Add(NpcID);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ return -1;
|
|
}
|
|
}
|
|
- else
|
|
|
|
|
|
+ else if (vl == "Border")
|
|
{
|
|
{
|
|
- // 使用正则表达式分割字符串
|
|
|
|
- string[] parts = Regex.Split(DressPropNameList[i], "_");
|
|
|
|
- int partID = int.Parse(parts[0]);
|
|
|
|
- if(flog_prefix == int.Parse(parts[0]))
|
|
|
|
- {
|
|
|
|
- if((flog_suffix == 3 && int.Parse(parts[1]) == 1)|| (flog_suffix == 1 && int.Parse(parts[1]) == 3))
|
|
|
|
- flog_prefix = 0;
|
|
|
|
- flog_suffix = 0;
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- flog_prefix = int.Parse(parts[0]);
|
|
|
|
- flog_suffix = int.Parse(parts[1]);
|
|
|
|
- DressPropIdList.Add(partID);
|
|
|
|
|
|
+ return -2;
|
|
}
|
|
}
|
|
|
|
+ else if (vl == "Npc")
|
|
|
|
+ {
|
|
|
|
+ return -3;
|
|
|
|
+ }
|
|
|
|
+ else if(!isNumeric)
|
|
|
|
+ {
|
|
|
|
+ return -4;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ id = int.Parse(parts[0]);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ return id;
|
|
|
|
+ }
|
|
|
|
+ public List<int> GetIDListByString(string name)
|
|
|
|
+ {
|
|
|
|
+ List<int> idList = new List<int>();
|
|
|
|
+ string[] parts = Regex.Split(name, "_");
|
|
|
|
+ foreach(string id in parts)
|
|
|
|
+ {
|
|
|
|
+ idList.Add(int.Parse(id));
|
|
|
|
+ }
|
|
|
|
+ return idList;
|
|
}
|
|
}
|
|
|
|
+ //将名字转换成道具id
|
|
|
|
+ //public void SetNameToIdList()
|
|
|
|
+ //{
|
|
|
|
+ // //DressPropIdList.Clear();
|
|
|
|
+ // int flog_prefix = 0;
|
|
|
|
+ // int flog_suffix = 0;
|
|
|
|
+ // for (int i = 0; i < DressPropNameList.Count; i++)
|
|
|
|
+ // {
|
|
|
|
+ // bool containsUnderscore = Regex.IsMatch(DressPropNameList[i], "_");
|
|
|
|
+ // if(!containsUnderscore)
|
|
|
|
+ // {
|
|
|
|
+ // if (DressPropNameList[i] == "Role")
|
|
|
|
+ // {
|
|
|
|
+ // DressPropIdList.Add(roleID);
|
|
|
|
+ // }
|
|
|
|
+ // else if (DressPropNameList[i] == "Border")
|
|
|
|
+ // {
|
|
|
|
+ // if (BorderID != 0)
|
|
|
|
+ // {
|
|
|
|
+ // DressPropIdList.Add(BorderID);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // else if (DressPropNameList[i] == "Npc")
|
|
|
|
+ // {
|
|
|
|
+ // if (NpcID != 0)
|
|
|
|
+ // {
|
|
|
|
+ // DressPropIdList.Add(NpcID);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // else
|
|
|
|
+ // {
|
|
|
|
+ // // 使用正则表达式分割字符串
|
|
|
|
+ // string[] parts = Regex.Split(DressPropNameList[i], "_");
|
|
|
|
+ // int partID = int.Parse(parts[0]);
|
|
|
|
+ // if(flog_prefix == int.Parse(parts[0]))
|
|
|
|
+ // {
|
|
|
|
+ // if((flog_suffix == 3 && int.Parse(parts[1]) == 1)|| (flog_suffix == 1 && int.Parse(parts[1]) == 3))
|
|
|
|
+ // {
|
|
|
|
+ // flog_prefix = 0;
|
|
|
|
+ // flog_suffix = 0;
|
|
|
|
+ // continue;
|
|
|
|
+ // }
|
|
|
|
+ // if ((flog_suffix == 2 && int.Parse(parts[1]) == 1) || (flog_suffix == 1 && int.Parse(parts[1]) == 2))
|
|
|
|
+ // {
|
|
|
|
+ // flog_prefix = 0;
|
|
|
|
+ // flog_suffix = 0;
|
|
|
|
+ // continue;
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // flog_prefix = int.Parse(parts[0]);
|
|
|
|
+ // flog_suffix = int.Parse(parts[1]);
|
|
|
|
+ // DressPropIdList.Add(partID);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
//将穿戴数据分类
|
|
//将穿戴数据分类
|
|
//public void ClassifyEquipData()
|
|
//public void ClassifyEquipData()
|
|
//{
|
|
//{
|
|
@@ -322,12 +439,16 @@ namespace GFGGame
|
|
//}
|
|
//}
|
|
public void InsertGameObjectList()
|
|
public void InsertGameObjectList()
|
|
{
|
|
{
|
|
- for(int i=0;i< DressPropIdList.Count;i++)
|
|
|
|
|
|
+ int i = 0;
|
|
|
|
+ foreach(var item in DressPropTransInfoDic)
|
|
{
|
|
{
|
|
- if (DressPropIdList[i] == roleID)
|
|
|
|
|
|
+ i++;
|
|
|
|
+ if (item.Key == roleID)
|
|
{
|
|
{
|
|
indexRoleData = i;
|
|
indexRoleData = i;
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
|
|
+ indexRoleData = i;
|
|
}
|
|
}
|
|
if(itemGameObjs.Count ==0)
|
|
if(itemGameObjs.Count ==0)
|
|
{
|
|
{
|
|
@@ -409,7 +530,8 @@ namespace GFGGame
|
|
Vector3 pos = Vector3.zero;
|
|
Vector3 pos = Vector3.zero;
|
|
if (!string.IsNullOrEmpty(itemCfg.resLayer3))
|
|
if (!string.IsNullOrEmpty(itemCfg.resLayer3))
|
|
{
|
|
{
|
|
- GameObject parentGameObj3 = new GameObject(string.Format("{0}_{1}", itemCfg.id, 3));
|
|
|
|
|
|
+ DressPropIndex++;
|
|
|
|
+ GameObject parentGameObj3 = new GameObject(string.Format("{0}_{1}_{2}", itemCfg.id, 3,DressPropIndex));
|
|
await PhotographSceneManager.Instance.AddSceneItem(parentGameObj3, itemCfg, 3, setLayer,false,isLeft);
|
|
await PhotographSceneManager.Instance.AddSceneItem(parentGameObj3, itemCfg, 3, setLayer,false,isLeft);
|
|
if (setLayer)
|
|
if (setLayer)
|
|
{
|
|
{
|
|
@@ -422,7 +544,8 @@ namespace GFGGame
|
|
}
|
|
}
|
|
if (!string.IsNullOrEmpty(itemCfg.resLayer2))
|
|
if (!string.IsNullOrEmpty(itemCfg.resLayer2))
|
|
{
|
|
{
|
|
- GameObject parentGameObj2 = new GameObject(string.Format("{0}_{1}", itemCfg.id, 2));
|
|
|
|
|
|
+ DressPropIndex++;
|
|
|
|
+ GameObject parentGameObj2 = new GameObject(string.Format("{0}_{1}_{2}", itemCfg.id, 2,DressPropIndex));
|
|
await PhotographSceneManager.Instance.AddSceneItem(parentGameObj2, itemCfg, 2, setLayer,false, isLeft);
|
|
await PhotographSceneManager.Instance.AddSceneItem(parentGameObj2, itemCfg, 2, setLayer,false, isLeft);
|
|
if (setLayer)
|
|
if (setLayer)
|
|
{
|
|
{
|
|
@@ -436,8 +559,8 @@ namespace GFGGame
|
|
}
|
|
}
|
|
if (!string.IsNullOrEmpty(itemCfg.resLayer1))
|
|
if (!string.IsNullOrEmpty(itemCfg.resLayer1))
|
|
{
|
|
{
|
|
-
|
|
|
|
- GameObject parentGameObj1 = new GameObject(string.Format("{0}_{1}", itemCfg.id, 1));
|
|
|
|
|
|
+ DressPropIndex++;
|
|
|
|
+ GameObject parentGameObj1 = new GameObject(string.Format("{0}_{1}_{2}", itemCfg.id, 1, DressPropIndex));
|
|
await PhotographSceneManager.Instance.AddSceneItem(parentGameObj1, itemCfg, 1, setLayer, false, isLeft);
|
|
await PhotographSceneManager.Instance.AddSceneItem(parentGameObj1, itemCfg, 1, setLayer, false, isLeft);
|
|
|
|
|
|
if (setLayer)
|
|
if (setLayer)
|
|
@@ -451,6 +574,25 @@ namespace GFGGame
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ public async void AddSceneItemOne(ItemCfg itemCfg, int layer,int index, int isLeft = 0, bool setLayer = true)
|
|
|
|
+ {
|
|
|
|
+ Vector3 pos = Vector3.zero;
|
|
|
|
+ if(DressPropIndex <= index)
|
|
|
|
+ {
|
|
|
|
+ DressPropIndex = index + 1;
|
|
|
|
+ }
|
|
|
|
+ GameObject parentGameObj3 = new GameObject(string.Format("{0}_{1}_{2}", itemCfg.id, layer, index));
|
|
|
|
+ await PhotographSceneManager.Instance.AddSceneItem(parentGameObj3, itemCfg, layer, setLayer, false, isLeft);
|
|
|
|
+ if (setLayer)
|
|
|
|
+ {
|
|
|
|
+ if (parentGameObj3.transform.childCount > 0)
|
|
|
|
+ {
|
|
|
|
+ parentGameObj3.transform.localPosition = -parentGameObj3.transform.GetChild(0).localPosition;
|
|
|
|
+ pos = parentGameObj3.transform.localPosition;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
public void OnClickBtnRule()
|
|
public void OnClickBtnRule()
|
|
{
|
|
{
|
|
ViewManager.Show<MatchingCompetitionRuleTipsView>();
|
|
ViewManager.Show<MatchingCompetitionRuleTipsView>();
|
|
@@ -464,7 +606,7 @@ namespace GFGGame
|
|
//人物位置信息
|
|
//人物位置信息
|
|
public TransformData roleTransFormData = new TransformData();
|
|
public TransformData roleTransFormData = new TransformData();
|
|
public GameObject roleGameobj;
|
|
public GameObject roleGameobj;
|
|
- public int roleID = -1;
|
|
|
|
|
|
+ public string roleID = "Role";
|
|
//*********************搭配数据*********************************
|
|
//*********************搭配数据*********************************
|
|
//需要传输的数据:MathingDressDate,DressUpBgID,DressPropIdList,TransformDataList,
|
|
//需要传输的数据:MathingDressDate,DressUpBgID,DressPropIdList,TransformDataList,
|
|
public DressUpData MathingDressDate = DressUpData.CreateDefault();
|
|
public DressUpData MathingDressDate = DressUpData.CreateDefault();
|
|
@@ -476,9 +618,13 @@ namespace GFGGame
|
|
public int NpcID = 0;
|
|
public int NpcID = 0;
|
|
//道具数据,一一对应
|
|
//道具数据,一一对应
|
|
//道具id
|
|
//道具id
|
|
- public List<int> DressPropIdList = new List<int>();
|
|
|
|
|
|
+ //public List<int> DressPropIdList = new List<int>();
|
|
//道具位置信息
|
|
//道具位置信息
|
|
public List<TransformData> TransformDataList = new List<TransformData>();
|
|
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 List<GameObject> itemGameObjs = new List<GameObject>();
|
|
//***************************************************************
|
|
//***************************************************************
|
|
//解析后台获取的信息
|
|
//解析后台获取的信息
|
|
@@ -487,27 +633,32 @@ namespace GFGGame
|
|
List<int> dressitemIDList = new List<int>();
|
|
List<int> dressitemIDList = new List<int>();
|
|
List<int> propIDList = new List<int>();
|
|
List<int> propIDList = new List<int>();
|
|
List<TransformData> transDataList = new List<TransformData>();
|
|
List<TransformData> transDataList = new List<TransformData>();
|
|
|
|
+ DressPropTransInfoDic.Clear();
|
|
for (int i = 0; i < OneRoleInfo.JudgingInfo.CollocationInfoList.Count; i++)
|
|
for (int i = 0; i < OneRoleInfo.JudgingInfo.CollocationInfoList.Count; i++)
|
|
{
|
|
{
|
|
- if (OneRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId == roleID)
|
|
|
|
|
|
+ CollocationInfo colloctItemInfo = OneRoleInfo.JudgingInfo.CollocationInfoList[i];
|
|
|
|
+ if (colloctItemInfo.ItemId == roleID)
|
|
{
|
|
{
|
|
- propIDList.Add(OneRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
|
|
|
|
- transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(OneRoleInfo.JudgingInfo.CollocationInfoList[i].ClientPosition));
|
|
|
|
|
|
+ //propIDList.Add(colloctItemInfo.ItemId);
|
|
|
|
+ //transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
|
|
|
|
+ if(!DressPropTransInfoDic.ContainsKey(colloctItemInfo.ItemId))
|
|
|
|
+ {
|
|
|
|
+ DressPropTransInfoDic.Add(colloctItemInfo.ItemId, MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(OneRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
|
|
|
|
|
|
+ ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(MatchingCompetitionDataManager.Instance.GetIDByString( colloctItemInfo.ItemId));
|
|
if (itemCfg != null && itemCfg.itemType == ConstItemType.DRESS_UP)
|
|
if (itemCfg != null && itemCfg.itemType == ConstItemType.DRESS_UP)
|
|
{
|
|
{
|
|
if (itemCfg.subType == 19 || itemCfg.subType == 17 || itemCfg.subType == 21 || itemCfg.subType == 22)
|
|
if (itemCfg.subType == 19 || itemCfg.subType == 17 || itemCfg.subType == 21 || itemCfg.subType == 22)
|
|
{
|
|
{
|
|
//记录道具和位置信息
|
|
//记录道具和位置信息
|
|
- propIDList.Add(OneRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
|
|
|
|
- transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(OneRoleInfo.JudgingInfo.CollocationInfoList[i].ClientPosition));
|
|
|
|
- if(itemCfg.resLayer2 == "t" || itemCfg.resLayer3 == "t")
|
|
|
|
|
|
+ //propIDList.Add(colloctItemInfo.ItemId);
|
|
|
|
+ //transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
|
|
|
|
+ if (!DressPropTransInfoDic.ContainsKey(colloctItemInfo.ItemId))
|
|
{
|
|
{
|
|
- propIDList.Add(-3);
|
|
|
|
- transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(OneRoleInfo.JudgingInfo.CollocationInfoList[i].ClientPosition));
|
|
|
|
|
|
+ DressPropTransInfoDic.Add(colloctItemInfo.ItemId, MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (itemCfg != null && itemCfg.subType == ConstDressUpItemType.BEI_JING)
|
|
else if (itemCfg != null && itemCfg.subType == ConstDressUpItemType.BEI_JING)
|
|
@@ -516,29 +667,35 @@ namespace GFGGame
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- dressitemIDList.Add(OneRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
|
|
|
|
|
|
+ dressitemIDList.Add(MatchingCompetitionDataManager.Instance.GetIDByString(colloctItemInfo.ItemId));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (itemCfg != null && itemCfg.itemType == ConstItemType.PHOTOGRAPH)
|
|
else if (itemCfg != null && itemCfg.itemType == ConstItemType.PHOTOGRAPH)
|
|
{
|
|
{
|
|
//记录道具和位置信息
|
|
//记录道具和位置信息
|
|
- propIDList.Add(OneRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
|
|
|
|
- transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(OneRoleInfo.JudgingInfo.CollocationInfoList[i].ClientPosition));
|
|
|
|
|
|
+ //propIDList.Add(colloctItemInfo.ItemId);
|
|
|
|
+ //transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
|
|
|
|
+ if (!DressPropTransInfoDic.ContainsKey(colloctItemInfo.ItemId))
|
|
|
|
+ {
|
|
|
|
+ DressPropTransInfoDic.Add(colloctItemInfo.ItemId, MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
MathingDressDate.itemList = dressitemIDList;
|
|
MathingDressDate.itemList = dressitemIDList;
|
|
MathingDressDate.actionId = OneRoleInfo.JudgingInfo.ActionId;
|
|
MathingDressDate.actionId = OneRoleInfo.JudgingInfo.ActionId;
|
|
- DressPropIdList = propIDList;
|
|
|
|
- TransformDataList = transDataList;
|
|
|
|
|
|
+ //DressPropIdList = propIDList;
|
|
|
|
+ //TransformDataList = transDataList;
|
|
DressUpBgID = OneRoleInfo.JudgingInfo.BagId;
|
|
DressUpBgID = OneRoleInfo.JudgingInfo.BagId;
|
|
}
|
|
}
|
|
public void InsertGameObjectList()
|
|
public void InsertGameObjectList()
|
|
{
|
|
{
|
|
int indexRoleData = 0;
|
|
int indexRoleData = 0;
|
|
- for (int i = 0; i < DressPropIdList.Count; i++)
|
|
|
|
|
|
+ int i = 0;
|
|
|
|
+ foreach (var item in DressPropTransInfoDic)
|
|
{
|
|
{
|
|
- if (DressPropIdList[i] == roleID)
|
|
|
|
|
|
+ i++;
|
|
|
|
+ if (item.Key == roleID)
|
|
{
|
|
{
|
|
indexRoleData = i;
|
|
indexRoleData = i;
|
|
}
|
|
}
|