Browse Source

搭配赛边框,npc部分补充提交

zhangyuqian 11 months ago
parent
commit
b178905e65

+ 62 - 8
GameClient/Assets/Game/HotUpdate/Data/MatchingCompetitionDataManager.cs

@@ -173,7 +173,10 @@ namespace GFGGame
                 {
                     //propIDList.Add(AllDressIDInfoList[i].ItemId);
                     //transDataList.Add(AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
-                    DressPropTransInfoDic.Add(AllDressIDInfoList[i].ItemId.ToString(), AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
+                    if (!DressPropTransInfoDic.ContainsKey(AllDressIDInfoList[i].ItemId))
+                    {
+                        DressPropTransInfoDic.Add(AllDressIDInfoList[i].ItemId.ToString(), AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
+                    }
                 }
                 else
                 {
@@ -187,7 +190,10 @@ namespace GFGGame
                             //transDataList.Add(AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
                             if(GetIDListByString(AllDressIDInfoList[i].ItemId).Count > 1)
                             {
-                                DressPropTransInfoDic.Add(AllDressIDInfoList[i].ItemId.ToString(), 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)
@@ -205,7 +211,10 @@ namespace GFGGame
                         //记录道具和位置信息
                         //propIDList.Add(GetIDByString(AllDressIDInfoList[i].ItemId));
                         //transDataList.Add(AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
-                        DressPropTransInfoDic.Add(AllDressIDInfoList[i].ItemId.ToString(), AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
+                        if (!DressPropTransInfoDic.ContainsKey(AllDressIDInfoList[i].ItemId))
+                        {
+                            DressPropTransInfoDic.Add(AllDressIDInfoList[i].ItemId.ToString(), AnalysisStringToTransform(AllDressIDInfoList[i].ClientPosition));
+                        }
                     }
                     else if(itemCfg == null)
                     {
@@ -253,6 +262,34 @@ namespace GFGGame
                     roleTransFormData.scale = itemGameObjs[i].transform.localScale;
                     TransformDataList.Add(roleTransFormData);
                     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
                 {
@@ -261,8 +298,12 @@ namespace GFGGame
                     itemData.scale = itemGameObjs[i].transform.localScale;
                     TransformDataList.Add(itemData);
                     DressPropNameList.Add(itemGameObjs[i].name);
+                    if(!DressPropTransInfoDic.ContainsKey(itemGameObjs[i].name))
+                    {
+                        DressPropTransInfoDic.Add(itemGameObjs[i].name, itemData);
+                    }  
                 }
-                DressPropTransInfoDic.Add(itemGameObjs[i].name, itemData);
+                
             }
             //SetNameToIdList();
         }
@@ -284,10 +325,14 @@ namespace GFGGame
                 {
                     return -2;
                 }
-                else if (!isNumeric)
+                else if (vl == "Npc")
                 {
                     return -3;
                 }
+                else if(!isNumeric)
+                {
+                    return -4;
+                }
 
                 id = int.Parse(parts[0]);
             }
@@ -590,7 +635,10 @@ namespace GFGGame
                 {
                     //propIDList.Add(colloctItemInfo.ItemId);
                     //transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
-                    DressPropTransInfoDic.Add(colloctItemInfo.ItemId, MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
+                    if(!DressPropTransInfoDic.ContainsKey(colloctItemInfo.ItemId))
+                    {
+                        DressPropTransInfoDic.Add(colloctItemInfo.ItemId, MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
+                    }    
                 }
                 else
                 {
@@ -602,7 +650,10 @@ namespace GFGGame
                             //记录道具和位置信息
                             //propIDList.Add(colloctItemInfo.ItemId);
                             //transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
-                            DressPropTransInfoDic.Add(colloctItemInfo.ItemId, MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
+                            if (!DressPropTransInfoDic.ContainsKey(colloctItemInfo.ItemId))
+                            {
+                                DressPropTransInfoDic.Add(colloctItemInfo.ItemId, MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
+                            }
                         }
                         else if (itemCfg != null && itemCfg.subType == ConstDressUpItemType.BEI_JING)
                         {
@@ -618,7 +669,10 @@ namespace GFGGame
                         //记录道具和位置信息
                         //propIDList.Add(colloctItemInfo.ItemId);
                         //transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
-                        DressPropTransInfoDic.Add(colloctItemInfo.ItemId, MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
+                        if (!DressPropTransInfoDic.ContainsKey(colloctItemInfo.ItemId))
+                        {
+                            DressPropTransInfoDic.Add(colloctItemInfo.ItemId, MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(colloctItemInfo.ClientPosition));
+                        }
                     }
                 }
             }

+ 18 - 1
GameClient/Assets/Game/HotUpdate/Data/PhotographSceneManager.cs

@@ -207,7 +207,24 @@ namespace GFGGame
         private void AddItemGameObjectToList(GameObject parentGameObj, bool setLayer)
         {
             List<GameObject> itemGameObjs = PhotographDataManager.Instance.itemGameObjs;
-            itemGameObjs.Add(parentGameObj);
+            bool hasSame = false;
+            for(int i =0; i<itemGameObjs.Count;i++)
+            {
+                if (itemGameObjs[i].name == parentGameObj.name && parentGameObj.name == "Npc")
+                {
+                    hasSame = true;
+                    itemGameObjs[i] = parentGameObj;
+                }
+                else if (itemGameObjs[i].name == parentGameObj.name && parentGameObj.name == "Border")
+                {
+                    hasSame = true;
+                    itemGameObjs[i] = parentGameObj;
+                }
+            }
+            if(!hasSame)
+            {
+                itemGameObjs.Add(parentGameObj);
+            }        
 
             if (setLayer)
             {

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/DressUp/PhotographView.cs

@@ -804,7 +804,7 @@ namespace GFGGame
                 if(MatchingCompetitionDataManager.Instance.NpcID != 0)
                 {
                     GameObject NpcGameObj = PhotographSceneManager.Instance.sceneObject.transform.Find("Scene/Npc").gameObject;
-                    MatchingCompetitionDataManager.Instance.itemGameObjs.Add(NpcGameObj);
+                    //MatchingCompetitionDataManager.Instance.itemGameObjs.Add(NpcGameObj);
                 }
                 MatchingCompetitionDataManager.Instance.MathingDressDate = MyDressUpHelper.dressUpObj.DressUpDataClone();
                 MatchingCompetitionDataManager.Instance.SetTransformData();

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Views/MatchingCompetition/MatchingCompetitionDetailView.cs

@@ -91,7 +91,9 @@ namespace GFGGame
             AllIdList.Remove(60000);
             AllIdList.Remove(-1);
             AllIdList.Remove(0);
+            AllIdList.Remove(-2);
             AllIdList.Remove(-3);
+            AllIdList.Remove(-4);
             _ui.m_dressList.numItems = AllIdList.Count;
         }
         private void UpdateDress()