Prechádzať zdrojové kódy

Merge remote-tracking branch 'remotes/origin/dev' into dev

# Conflicts:
#	GameClient/Assets/Game/HotUpdate/Data/MatchingPhotoHelper.cs
#	GameClient/Assets/Game/HotUpdate/ServerProxy/MatchingCompetitionSproxy.cs
#	GameClient/Assets/Game/HotUpdate/Views/MatchingCompetition/MatchingCompetitionUpLoadView.cs
hexiaojie 11 mesiacov pred
rodič
commit
1134ddb07c

+ 79 - 10
GameClient/Assets/Game/HotUpdate/Data/MatchingCompetitionDataManager.cs

@@ -1,4 +1,5 @@
-using ET;
+
+using ET;
 using System;
 using System.Collections;
 using System.Collections.Generic;
@@ -7,6 +8,7 @@ using UnityEngine;
 using Live2D.Cubism.Rendering;
 using FairyGUI;
 using UI.MatchingCompetition;
+using System.IO;
 
 namespace GFGGame
 {
@@ -173,7 +175,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 +192,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 +213,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 +264,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,24 +300,45 @@ 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();
         }
+
         public int GetIDByString(string name)
         {
             int id = 0;
             //使用正则表达式分割字符串
             string[] parts = Regex.Split(name, "_");
-            if(parts.Length > 0)
+            if (parts.Length > 0)
             {
-                if(parts[0] == "Role")
+                string vl = parts[0];
+                bool isNumeric = int.TryParse(vl, out _);
+                if (vl == "Role")
                 {
                     return -1;
                 }
+                else if (vl == "Border")
+                {
+                    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)
@@ -577,7 +637,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
                 {
@@ -589,7 +652,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)
                         {
@@ -605,7 +671,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)
             {

+ 3 - 3
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/MatchingCompetition/UI_Component6.cs

@@ -9,10 +9,10 @@ namespace UI.MatchingCompetition
         public GComponent target;
         public Controller m_c1;
         public GLoader m_playerImage;
+        public GTextField m_descText;
         public GComponent m_head;
         public GTextField m_nameText;
         public GTextField m_countText;
-        public GTextField m_descText;
         public const string URL = "ui://ri3cveycp3ft1q";
         public const string PACKAGE_NAME = "MatchingCompetition";
         public const string RES_NAME = "Component6";
@@ -62,19 +62,19 @@ namespace UI.MatchingCompetition
         {
             m_c1 = comp.GetController("c1");
             m_playerImage = (GLoader)comp.GetChild("playerImage");
+            m_descText = (GTextField)comp.GetChild("descText");
             m_head = (GComponent)comp.GetChild("head");
             m_nameText = (GTextField)comp.GetChild("nameText");
             m_countText = (GTextField)comp.GetChild("countText");
-            m_descText = (GTextField)comp.GetChild("descText");
         }
         public void Dispose(bool disposeTarget = false)
         {
             m_c1 = null;
             m_playerImage = null;
+            m_descText = null;
             m_head = null;
             m_nameText = null;
             m_countText = null;
-            m_descText = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 12 - 9
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/MatchingCompetition/UI_MatchingCompetitionRankUI.cs

@@ -10,12 +10,13 @@ namespace UI.MatchingCompetition
         public Controller m_c1;
         public GLoader m_bg;
         public GLoader m_playerImage;
-        public GLoader m_ruleBtn;
-        public GTextField m_titleText;
-        public GButton m_btnBefore;
+        public GLoader m_outBg;
         public GList m_RankList;
         public UI_Component3 m_playerHead;
         public GButton m_btnLook;
+        public GLoader m_ruleBtn;
+        public GTextField m_titleText;
+        public GButton m_btnBefore;
         public GButton m_BtnBack;
         public const string URL = "ui://ri3cveycp3ft1g";
         public const string PACKAGE_NAME = "MatchingCompetition";
@@ -67,12 +68,13 @@ namespace UI.MatchingCompetition
             m_c1 = comp.GetController("c1");
             m_bg = (GLoader)comp.GetChild("bg");
             m_playerImage = (GLoader)comp.GetChild("playerImage");
-            m_ruleBtn = (GLoader)comp.GetChild("ruleBtn");
-            m_titleText = (GTextField)comp.GetChild("titleText");
-            m_btnBefore = (GButton)comp.GetChild("btnBefore");
+            m_outBg = (GLoader)comp.GetChild("outBg");
             m_RankList = (GList)comp.GetChild("RankList");
             m_playerHead = (UI_Component3)UI_Component3.Create(comp.GetChild("playerHead"));
             m_btnLook = (GButton)comp.GetChild("btnLook");
+            m_ruleBtn = (GLoader)comp.GetChild("ruleBtn");
+            m_titleText = (GTextField)comp.GetChild("titleText");
+            m_btnBefore = (GButton)comp.GetChild("btnBefore");
             m_BtnBack = (GButton)comp.GetChild("BtnBack");
         }
         public void Dispose(bool disposeTarget = false)
@@ -80,13 +82,14 @@ namespace UI.MatchingCompetition
             m_c1 = null;
             m_bg = null;
             m_playerImage = null;
-            m_ruleBtn = null;
-            m_titleText = null;
-            m_btnBefore = null;
+            m_outBg = null;
             m_RankList = null;
             m_playerHead.Dispose();
             m_playerHead = null;
             m_btnLook = null;
+            m_ruleBtn = null;
+            m_titleText = null;
+            m_btnBefore = null;
             m_BtnBack = null;
             if(disposeTarget && target != null)
             {

+ 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()

+ 3 - 2
GameClient/Assets/Game/HotUpdate/Views/MatchingCompetition/MatchingCompetitionRankView.cs

@@ -40,6 +40,7 @@ namespace GFGGame
         {
             base.OnShown();
             _ui.m_bg.url = ResPathUtil.GetBgImgPath("pxs_bj");
+            _ui.m_outBg.url = ResPathUtil.GetBgImgPath("pxs_pmdb");
             _ui.m_titleText.text = JudgingRoundOpenCfgArray.Instance.dataArray[MatchingCompetitionDataManager.Instance.MatchingCompetitionSeason - 1].Name;
             UpdateView();
             UpdateHead();
@@ -61,7 +62,7 @@ namespace GFGGame
             EventAgent.RemoveEventListener(ConstMessage.DOWNLOAD_FINISH, UpdateView);
             EventAgent.RemoveEventListener(ConstMessage.REQ_CURRENT_RANK, UpdateView);
         }
-        private void UpdateView()
+     private void UpdateView()
         {
             if(MatchingCompetitionDataManager.Instance._currentRankList.Count > 0)
             {
@@ -99,7 +100,7 @@ namespace GFGGame
             item.target.data = index;
             UI_Component3.ProxyEnd();
         }
-        private void OnClickBtnItem(EventContext context)
+       private void OnClickBtnItem(EventContext context)
         {
             GObject item = context.sender as GObject;
             int index = (int)item.data; 

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/MatchingCompetition/MatchingCompetitionWorkListView.cs

@@ -61,7 +61,7 @@ namespace GFGGame
         {
             _ui.m_workList.numItems = MatchingCompetitionDataManager.Instance._BeforeRankList.Count;
         }
-        private void RenderRankList(int index, GObject obj)
+         private void RenderRankList(int index, GObject obj)
         {
             UI_Component6 item = UI_Component6.Proxy(obj);
             if((index +1) >=1 && (index + 1)<=3)

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Views/Poem/PoemPhotoView.cs

@@ -164,6 +164,7 @@ namespace GFGGame
         {
             if (_ui.m_c1.selectedIndex == 0)
             {
+                _ui.m_btnDelete.visible = true;
                 _ui.m_listTravel.numItems = 0;
                 _ui.m_descText.visible = false;
                 _photoInfos = PoemPhotoDataManager.Instance.PersonalPhotoInfos;
@@ -173,6 +174,7 @@ namespace GFGGame
             }
             else if(_ui.m_c1.selectedIndex == 1)
             {
+                _ui.m_btnDelete.visible = true;
                 _ui.m_list.numItems = 0;
                 _ui.m_descText.visible = false;
                 _photoInfos = PoemPhotoDataManager.Instance.WsqsPhotoInfos;

BIN
GameClient/Assets/ResIn/UI/MatchingCompetition/MatchingCompetition_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/MatchingCompetition/MatchingCompetition_atlas0.png


BIN
GameClient/Assets/ResIn/UI/MatchingCompetition/MatchingCompetition_atlas0_1!a.png


BIN
GameClient/Assets/ResIn/UI/MatchingCompetition/MatchingCompetition_atlas0_1.png


BIN
GameClient/Assets/ResIn/UI/MatchingCompetition/MatchingCompetition_fui.bytes