zhangyuqian 1 жил өмнө
parent
commit
84d89dd3bd

+ 26 - 14
GameClient/Assets/Game/HotUpdate/Data/MatchingCompetitionDataManager.cs

@@ -341,7 +341,7 @@ namespace GFGGame
             {
                 c1 = 0;
             }
-            else if(index >9 && index <= 20)
+            else if(index >9 && index <= 50)
             {
                 c1 = 1;
             }
@@ -364,17 +364,37 @@ namespace GFGGame
             }
             else
             {
-                rankCom.m_RankText.text = index.ToString();
+                if (index == 0)
+                {
+                    rankCom.m_RankText.text = "--";
+                }
+                else
+                {
+                    for (int i = 11; i < JudgingRoundRewardCfgArray.Instance.dataArray.Length-1; i++)
+                    {
+                        JudgingRoundRewardCfg judgingCfg = JudgingRoundRewardCfgArray.Instance.GetCfg(i);
+                        JudgingRoundRewardCfg judgingNextCfg = JudgingRoundRewardCfgArray.Instance.GetCfg(i+1);
+                        if (index >= judgingCfg.rank && index < judgingNextCfg.rank)
+                        {
+                            rankCom.m_RankText.text = judgingNextCfg.desc;
+                        }
+                        else
+                        {
+                            rankCom.m_RankText.text = index.ToString();
+                        }
+                    }
+                }
+                
             }
 
         }
-        public async void AddSceneItem(ItemCfg itemCfg, bool setLayer)
+        public async void AddSceneItem(ItemCfg itemCfg, bool setLayer,int isLeft = 0)
         {
             Vector3 pos = Vector3.zero;
             if (!string.IsNullOrEmpty(itemCfg.resLayer3))
             {
                 GameObject parentGameObj3 = new GameObject(string.Format("{0}_{1}", itemCfg.id, 3));
-                await PhotographSceneManager.Instance.AddSceneItem(parentGameObj3, itemCfg, 3, setLayer);
+                await PhotographSceneManager.Instance.AddSceneItem(parentGameObj3, itemCfg, 3, setLayer,false,isLeft);
                 if (setLayer)
                 {
                     if (parentGameObj3.transform.childCount > 0)
@@ -387,7 +407,7 @@ namespace GFGGame
             if (!string.IsNullOrEmpty(itemCfg.resLayer2))
             {
                 GameObject parentGameObj2 = new GameObject(string.Format("{0}_{1}", itemCfg.id, 2));
-                await PhotographSceneManager.Instance.AddSceneItem(parentGameObj2, itemCfg, 2, setLayer);
+                await PhotographSceneManager.Instance.AddSceneItem(parentGameObj2, itemCfg, 2, setLayer,false, isLeft);
                 if (setLayer)
                 {
                     if (parentGameObj2.transform.childCount > 0)
@@ -402,7 +422,7 @@ namespace GFGGame
             {
 
                 GameObject parentGameObj1 = new GameObject(string.Format("{0}_{1}", itemCfg.id, 1));
-                await PhotographSceneManager.Instance.AddSceneItem(parentGameObj1, itemCfg, 1, setLayer);
+                await PhotographSceneManager.Instance.AddSceneItem(parentGameObj1, itemCfg, 1, setLayer, false, isLeft);
 
                 if (setLayer)
                 {
@@ -507,12 +527,4 @@ namespace GFGGame
             }
         }
     }
-
-    class MatchingTwoDataManager : SingletonBase<MatchingTwoDataManager>
-    {
-        //其他玩家信息用于展示
-        public MatchingPhotoWorksData LeftRoleInfo = new MatchingPhotoWorksData();
-        //其他玩家信息用于展示
-        public MatchingPhotoWorksData RightRoleInfo = new MatchingPhotoWorksData();
-    }
 }

+ 186 - 0
GameClient/Assets/Game/HotUpdate/Data/MatchingTwoDataManager.cs

@@ -0,0 +1,186 @@
+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 int roleID = -1;
+        //*********************搭配数据*********************************
+        //需要传输的数据: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 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>();
+            for (int i = 0; i < LeftRoleInfo.JudgingInfo.CollocationInfoList.Count; i++)
+            {
+                if (LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId == roleID)
+                {
+                    propIDList.Add(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
+                }
+                else
+                {
+                    ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
+                    if (itemCfg != null && itemCfg.itemType == ConstItemType.DRESS_UP)
+                    {
+                        if (itemCfg.subType == 9 || itemCfg.subType == 10 || itemCfg.subType == 11 || itemCfg.subType == 12)
+                        {
+                            //记录道具和位置信息
+                            propIDList.Add(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
+                            transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ClientPosition));
+                        }
+                        else
+                        {
+                            dressitemIDList.Add(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
+                        }
+                    }
+                    else if (itemCfg != null && itemCfg.itemType == ConstItemType.PHOTOGRAPH)
+                    {
+                        //记录道具和位置信息
+                        propIDList.Add(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
+                        transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(LeftRoleInfo.JudgingInfo.CollocationInfoList[i].ClientPosition));
+                    }
+                }
+            }
+            MathingDressDate.itemList = dressitemIDList;
+            MathingDressDate.actionId = LeftRoleInfo.JudgingInfo.ActionId;
+            DressPropIdList = propIDList;
+            TransformDataList = transDataList;
+            DressUpBgID = LeftRoleInfo.JudgingInfo.BagId;
+        }
+        public void InsertGameObjectList()
+        {
+            int indexRoleData = 0;
+            for (int i = 0; i < DressPropIdList.Count; i++)
+            {
+                if (DressPropIdList[i] == roleID)
+                {
+                    indexRoleData = i;
+                }
+            }
+            if (itemGameObjs.Count == 0)
+            {
+                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 int roleID = -1;
+        //*********************搭配数据*********************************
+        //需要传输的数据: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 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>();
+            for (int i = 0; i < RightRoleInfo.JudgingInfo.CollocationInfoList.Count; i++)
+            {
+                if (RightRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId == roleID)
+                {
+                    propIDList.Add(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
+                }
+                else
+                {
+                    ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
+                    if (itemCfg != null && itemCfg.itemType == ConstItemType.DRESS_UP)
+                    {
+                        if (itemCfg.subType == 9 || itemCfg.subType == 10 || itemCfg.subType == 11 || itemCfg.subType == 12)
+                        {
+                            //记录道具和位置信息
+                            propIDList.Add(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
+                            transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ClientPosition));
+                        }
+                        else
+                        {
+                            dressitemIDList.Add(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
+                        }
+                    }
+                    else if (itemCfg != null && itemCfg.itemType == ConstItemType.PHOTOGRAPH)
+                    {
+                        //记录道具和位置信息
+                        propIDList.Add(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ItemId);
+                        transDataList.Add(MatchingCompetitionDataManager.Instance.AnalysisStringToTransform(RightRoleInfo.JudgingInfo.CollocationInfoList[i].ClientPosition));
+                    }
+                }
+            }
+            MathingDressDate.itemList = dressitemIDList;
+            MathingDressDate.actionId = RightRoleInfo.JudgingInfo.ActionId;
+            DressPropIdList = propIDList;
+            TransformDataList = transDataList;
+            DressUpBgID = RightRoleInfo.JudgingInfo.BagId;
+        }
+        public void InsertGameObjectList()
+        {
+            int indexRoleData = 0;
+            for (int i = 0; i < DressPropIdList.Count; i++)
+            {
+                if (DressPropIdList[i] == roleID)
+                {
+                    indexRoleData = i;
+                }
+            }
+            if (itemGameObjs.Count == 0)
+            {
+                itemGameObjs.Add(roleGameobj);
+            }
+            else
+            {
+                itemGameObjs.Insert(indexRoleData, roleGameobj);
+            }
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Data/MatchingTwoDataManager.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: f840fc6b2d52a1d4fbbc79221ec6e67f
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

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

@@ -69,10 +69,18 @@ namespace GFGGame
             AddItemGameObjectToList(bodyParent, false);
         }
 
-        public async Task AddSceneItem(GameObject parentGameObj, ItemCfg itemCfg, int layer, bool setLayer, bool isOnlyEff = false)
+        public async Task AddSceneItem(GameObject parentGameObj, ItemCfg itemCfg, int layer, bool setLayer, bool isOnlyEff = false,int isLeft = 0)
         {
             MatchingCompetitionDataManager.Instance.itemGameObjs.Add(parentGameObj);
             MatchingOneDataManager.Instance.itemGameObjs.Add(parentGameObj);
+            if(isLeft == 1)
+            {
+                MatchingLeftDataManager.Instance.itemGameObjs.Add(parentGameObj);
+            }
+            else if(isLeft == 2)
+            {
+                MatchingRightDataManager.Instance.itemGameObjs.Add(parentGameObj);
+            }
 
             await AddItemToScene(sceneObject, parentGameObj, itemCfg.id, layer);
 

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Main/UI_StoryDialogUI.cs

@@ -13,6 +13,7 @@ namespace UI.Main
         public GGraph m_mask2;
         public GGraph m_btnNext;
         public GGraph m_effect;
+        public GGraph m_roleLive;
         public UI_CompDialogText m_dialogText;
         public UI_CompDialogName m_dialogName;
         public UI_CompDialogHead m_dialogHead;
@@ -86,6 +87,7 @@ namespace UI.Main
             m_mask2 = (GGraph)comp.GetChild("mask2");
             m_btnNext = (GGraph)comp.GetChild("btnNext");
             m_effect = (GGraph)comp.GetChild("effect");
+            m_roleLive = (GGraph)comp.GetChild("roleLive");
             m_dialogText = (UI_CompDialogText)UI_CompDialogText.Create(comp.GetChild("dialogText"));
             m_dialogName = (UI_CompDialogName)UI_CompDialogName.Create(comp.GetChild("dialogName"));
             m_dialogHead = (UI_CompDialogHead)UI_CompDialogHead.Create(comp.GetChild("dialogHead"));
@@ -115,6 +117,7 @@ namespace UI.Main
             m_mask2 = null;
             m_btnNext = null;
             m_effect = null;
+            m_roleLive = null;
             m_dialogText.Dispose();
             m_dialogText = null;
             m_dialogName.Dispose();

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

@@ -8,6 +8,7 @@ namespace UI.MatchingCompetition
     {
         public GComponent target;
         public GLoader m_playerImage;
+        public GGraph m_player;
         public const string URL = "ui://ri3cveycp3ft22";
         public const string PACKAGE_NAME = "MatchingCompetition";
         public const string RES_NAME = "Component14";
@@ -56,10 +57,12 @@ namespace UI.MatchingCompetition
         private void Init(GComponent comp)
         {
             m_playerImage = (GLoader)comp.GetChild("playerImage");
+            m_player = (GGraph)comp.GetChild("player");
         }
         public void Dispose(bool disposeTarget = false)
         {
             m_playerImage = null;
+            m_player = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 17 - 6
GameClient/Assets/Game/HotUpdate/ServerProxy/MatchingCompetitionSproxy.cs

@@ -101,16 +101,19 @@ namespace GFGGame
             {
                 return false;
             }
-            MatchingTwoDataManager.Instance.LeftRoleInfo.JudgingInfo = response.JudgingRoundRoleInfoList[0];
+            MatchingLeftDataManager.Instance.LeftRoleInfo.JudgingInfo = response.JudgingRoundRoleInfoList[0];
             if(response.JudgingRoundRoleInfoList[0] != null)
             {
-                Timers.inst.StartCoroutine(MatchingPhotoHelper.Download(MatchingTwoDataManager.Instance.LeftRoleInfo));
+                Timers.inst.StartCoroutine(MatchingPhotoHelper.Download(MatchingLeftDataManager.Instance.LeftRoleInfo));
             }
-            MatchingTwoDataManager.Instance.RightRoleInfo.JudgingInfo = response.JudgingRoundRoleInfoList[1];
+            MatchingLeftDataManager.Instance.AnalysisInfoToList();
+
+            MatchingRightDataManager.Instance.RightRoleInfo.JudgingInfo = response.JudgingRoundRoleInfoList[1];
             if (response.JudgingRoundRoleInfoList[1] != null)
             {
-                Timers.inst.StartCoroutine(MatchingPhotoHelper.Download(MatchingTwoDataManager.Instance.RightRoleInfo));
+                Timers.inst.StartCoroutine(MatchingPhotoHelper.Download(MatchingRightDataManager.Instance.RightRoleInfo));
             }
+            MatchingRightDataManager.Instance.AnalysisInfoToList();
             return true;
         }
         //选择搭配作品
@@ -126,8 +129,16 @@ namespace GFGGame
             {
                 return false;
             }
-            MatchingTwoDataManager.Instance.LeftRoleInfo.JudgingInfo = response.JudgingRoundRoleInfoList[0];
-            MatchingTwoDataManager.Instance.RightRoleInfo.JudgingInfo = response.JudgingRoundRoleInfoList[1];
+            if(MatchingLeftDataManager.Instance.LeftRoleInfo.JudgingInfo.WorksId == workID)
+            {
+                MatchingLeftDataManager.Instance.LeftRoleInfo.JudgingInfo = response.JudgingRoundRoleInfoList[0];
+                MatchingRightDataManager.Instance.RightRoleInfo.JudgingInfo = response.JudgingRoundRoleInfoList[1];
+            }
+            else
+            {
+                MatchingLeftDataManager.Instance.LeftRoleInfo.JudgingInfo = response.JudgingRoundRoleInfoList[1];
+                MatchingRightDataManager.Instance.RightRoleInfo.JudgingInfo = response.JudgingRoundRoleInfoList[0];
+            }
             BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(response.BonusList));
             return true;
         }

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

@@ -511,7 +511,7 @@ namespace GFGGame
         {
             _currentList2 = null;
             currentListType = DressUpListType.List1;
-            if (this.viewData != null &&(int)this.viewData != 2)
+            if (this.viewData == null || (int)this.viewData != 2)
             {
                 _ui.m_comListType1.m_listType.numItems = DressUpMenuItemCfg1Array.Instance.dataArray.Length;
             }

+ 30 - 5
GameClient/Assets/Game/HotUpdate/Views/MatchingCompetition/MatchingCompetitionDetailView.cs

@@ -176,8 +176,17 @@ namespace GFGGame
         {
             UI_MatchingDressItem item = UI_MatchingDressItem.Proxy(obj);
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(IdList[index]);
-            item.m_icon.url = ResPathUtil.GetIconPath(itemCfg.res, "png");
-            item.m_txtTitle.text = itemCfg.name;
+            SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(IdList[index]);
+            if (itemCfg != null)
+            {
+                item.m_icon.url = ResPathUtil.GetIconPath(itemCfg.res, "png");
+                item.m_txtTitle.text = itemCfg.name;
+            }
+            else if (suitCfg != null)
+            {
+                item.m_icon.url = ResPathUtil.GetIconPath(suitCfg.res, "png");
+                item.m_txtTitle.text = suitCfg.name;
+            }
             UI_MatchingDressItem.ProxyEnd();
         }
         private void OnClickListType1Item(EventContext context)
@@ -187,7 +196,18 @@ namespace GFGGame
             IdList.Clear();
             foreach (var idItem in AllIdList)
             {
-                    ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(idItem);
+                ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(idItem);
+                SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(idItem);
+                if(itemCfg == null && suitCfg == null)
+                {
+                        continue;                  
+                }
+                else if(itemCfg != null)
+                {
+                    if (idItem == 10000 || idItem == 20000 || idItem == 30000 || idItem == 50000 || idItem == 60000)
+                    {
+                        continue;
+                    }
                     if (index.type != 0)
                     {
                         if (itemCfg.subType == index.type)
@@ -197,14 +217,19 @@ namespace GFGGame
                     }
                     else
                     {
-                        foreach(var itemSubMenus in index.subMenusArr)
+                        foreach (var itemSubMenus in index.subMenusArr)
                         {
-                            if(DressUpMenuItemCfg2Array.Instance.dataArray[(itemSubMenus -1)].type == itemCfg.subType)
+                            if (DressUpMenuItemCfg2Array.Instance.dataArray[(itemSubMenus - 1)].type == itemCfg.subType)
                             {
                                 IdList.Add(idItem);
                             }
                         }
                     }
+                }
+                else if (index.type == 25 && suitCfg != null)
+                {
+                    IdList.Add(idItem);
+                }
             }
             _ui.m_dressList.numItems = IdList.Count;
             _ui.m_dressList.visible = true;

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

@@ -102,7 +102,7 @@ namespace GFGGame
         {
             long endTime = MatchingCompetitionDataManager.Instance.MatchingEndTimes;
             long curTime = TimeHelper.ServerNow();
-            if(MatchingCompetitionDataManager.Instance.MatchingState != 1)
+            if (MatchingCompetitionDataManager.Instance.MatchingState != 1)
             {
                 Timers.inst.Remove(UpdateTime);
                 PromptController.Instance.ShowFloatTextPrompt("投稿时间已到!");

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

@@ -59,7 +59,14 @@ namespace GFGGame
         {
             UI_MatchingCompetitionRewardItem item = UI_MatchingCompetitionRewardItem.Proxy(obj);
             JudgingRoundRewardCfg judginRewardCfg = JudgingRoundRewardCfgArray.Instance.dataArray[index];
-            item.m_rankIndex.text = judginRewardCfg.desc;
+            if (index < 10)
+            {
+                item.m_rankIndex.text = "第" + judginRewardCfg.desc + "名";
+            }
+            else
+            {
+                item.m_rankIndex.text = judginRewardCfg.desc;
+            }
             if (item.m_rewardList.data == null)
             {
                 item.m_rewardList.itemRenderer = SpecialRewardRender;

+ 186 - 14
GameClient/Assets/Game/HotUpdate/Views/MatchingCompetition/MatchingCompetitionSelectView.cs

@@ -1,9 +1,11 @@
 using System;
 using System.Collections.Generic;
+using System.Threading.Tasks;
 using ET;
 using FairyGUI;
 using UI.MatchingCompetition;
 using UnityEngine;
+using UnityEngine.UI;
 
 namespace GFGGame
 {
@@ -12,12 +14,24 @@ namespace GFGGame
         private UI_MatchingCompetitionSelectUI _ui;
         private int _seasonIndex = 0;
         private bool isRefresh = false;
+        private GameObject _sceneObjectLeft;
+        private GameObject _sceneObjectRight;
         public override void Dispose()
         {
             if (_ui != null)
             {
                 _ui.Dispose();
             }
+            if (_sceneObjectLeft != null)
+            {
+                PrefabManager.Instance.Restore(_sceneObjectLeft);
+                _sceneObjectLeft = null;
+            }
+            if (_sceneObjectRight != null)
+            {
+                PrefabManager.Instance.Restore(_sceneObjectRight);
+                _sceneObjectRight = null;
+            }
             _ui = null;
             base.Dispose();
         }
@@ -42,41 +56,179 @@ namespace GFGGame
             _ui.m_bg.url = ResPathUtil.GetBgImgPath("gzs_fb_bj");
             _ui.m_BtnBack.touchable = true;
             _ui.m_titleText.text = JudgingRoundOpenCfgArray.Instance.dataArray[MatchingCompetitionDataManager.Instance.MatchingCompetitionSeason - 1].Name;
-            //isRefresh = (bool)this.viewData;
+            //isRefresh = (bool)this.viewData;       
             UpdateView();
-            UpdatePlayer();
+            UpdateDressLeft();
+            ViewManager.Hide<ModalStatusView>();
         }
 
         protected override void OnHide()
         {
+            if (_sceneObjectLeft != null)
+            {
+                PrefabManager.Instance.Restore(_sceneObjectLeft);
+                _sceneObjectLeft = null;
+            }
+            if (_sceneObjectRight != null)
+            {
+                PrefabManager.Instance.Restore(_sceneObjectRight);
+                _sceneObjectRight = null;
+            }
             base.OnHide();
         }
         protected override void AddEventListener()
         {
             base.AddEventListener();
-            EventAgent.AddEventListener(ConstMessage.DOWNLOAD_FINISH, UpdatePlayer);
+            //EventAgent.AddEventListener(ConstMessage.DOWNLOAD_FINISH, UpdatePlayer);
+            //EventAgent.AddEventListener(ConstMessage.DOWNLOAD_FINISH, UpdateDressLeft);
         }
         protected override void RemoveEventListener()
         {
             base.RemoveEventListener();
-            EventAgent.RemoveEventListener(ConstMessage.DOWNLOAD_FINISH, UpdatePlayer);
+            //EventAgent.RemoveEventListener(ConstMessage.DOWNLOAD_FINISH, UpdatePlayer);
+            //EventAgent.RemoveEventListener(ConstMessage.DOWNLOAD_FINISH, UpdateDressLeft);
+        }
+        private async void UpdateDressLeft()
+        {
+            //ViewManager.Show<ModalStatusView>("获取搭配数据中...");
+            MatchingLeftDataManager.Instance.itemGameObjs.Clear();
+            PhotographDataManager.Instance.itemGameObjs.Clear();
+            PhotographDataManager.Instance.dressUpObj?.Dispose();
+            PhotographDataManager.Instance.dressUpObj = new DressUpObj();
+            if (_sceneObjectLeft == null)
+            {
+                _sceneObjectLeft = PrefabManager.Instance.InstantiateSync(ResPathUtil.GetPrefabPath("ScenePhotograph"));
+                // 创建render texture
+                renderTexureLeft = new RenderTexture((int)_ui.target.width, (int)_ui.target.height, 24);
+
+                // 换装父节点 + 相机            
+                Camera camera = _sceneObjectLeft.transform.Find("Camera").GetComponent<Camera>();
+                camera.gameObject.SetActive(true);
+                camera.targetTexture = renderTexureLeft;
+                // 创建RawImg
+                
+            }
+
+            PhotographSceneManager.Instance.sceneObject = _sceneObjectLeft;
+            if (MatchingLeftDataManager.Instance.DressUpBgID == 0)
+            {
+                PhotographSceneManager.Instance.AddBgItem(ItemCfgArray.Instance.GetCfg(180001));
+            }
+            else
+            {
+                PhotographSceneManager.Instance.AddBgItem(ItemCfgArray.Instance.GetCfg(MatchingLeftDataManager.Instance.DressUpBgID));
+            }
+            PhotographSceneManager.Instance.AddBodyItem();
+            GameObject bodyParent = _sceneObjectLeft.transform.Find("Scene/Role").gameObject;
+            PhotographDataManager.Instance.dressUpObj.setSceneObj(_sceneObjectLeft, false, true, bodyParent, false, null);
+            PhotographDataManager.Instance.dressUpObj.PutOnDressUpData(MatchingLeftDataManager.Instance.MathingDressDate);
+
+            //对搭配赛特殊处理
+            for (int i = 0; i < MatchingLeftDataManager.Instance.DressPropIdList.Count; i++)
+            {
+                if (MatchingLeftDataManager.Instance.DressPropIdList[i] <= 0)
+                {
+                    continue;
+                }
+                else
+                {
+                    ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(MatchingLeftDataManager.Instance.DressPropIdList[i]);
+                    ET.Log.Debug(string.Format("zyq:{0}", MatchingLeftDataManager.Instance.DressPropIdList[i]));
+                    MatchingCompetitionDataManager.Instance.AddSceneItem(itemCfg, true,1);
+                }
+            }
+            await Task.Delay(100);
+            MatchingLeftDataManager.Instance.InsertGameObjectList();
+            for (int i = 0; i < MatchingLeftDataManager.Instance.TransformDataList.Count; i++)
+            {
+                TransformData itemdata = MatchingLeftDataManager.Instance.TransformDataList[i];
+                GameObject itemGObj = MatchingLeftDataManager.Instance.itemGameObjs[i];
+                MatchingLeftDataManager.Instance.itemGameObjs[i].transform.position = itemdata.position;
+                MatchingLeftDataManager.Instance.itemGameObjs[i].transform.Rotate(itemGObj.transform.eulerAngles.x, itemGObj.transform.eulerAngles.y, itemdata.rotationZ);
+                MatchingLeftDataManager.Instance.itemGameObjs[i].transform.localScale = itemdata.scale;
+                PhotographUtil.Instance.ChangeLayer(MatchingLeftDataManager.Instance.itemGameObjs[i], i * PhotographDataManager.layerCount, "up");
+            }
+            UpdateDressRigh();
+        }
+        private async void UpdateDressRigh()
+        {
+            MatchingRightDataManager.Instance.itemGameObjs.Clear();
+            PhotographDataManager.Instance.itemGameObjs.Clear();
+            PhotographDataManager.Instance.dressUpObj?.Dispose();
+            PhotographDataManager.Instance.dressUpObj = new DressUpObj();
+            if (_sceneObjectRight == null)
+            {
+                _sceneObjectRight = PrefabManager.Instance.InstantiateSync(ResPathUtil.GetPrefabPath("ScenePhotograph"));
+                // 创建render texture
+                renderTexureRight = new RenderTexture((int)_ui.target.width, (int)_ui.target.height, 24);
+
+                // 换装父节点 + 相机            
+                Camera camera = _sceneObjectRight.transform.Find("Camera").GetComponent<Camera>();
+                camera.gameObject.SetActive(true);
+                camera.targetTexture = renderTexureRight;
+            }
+
+            PhotographSceneManager.Instance.sceneObject = _sceneObjectRight;
+            if (MatchingRightDataManager.Instance.DressUpBgID == 0)
+            {
+                PhotographSceneManager.Instance.AddBgItem(ItemCfgArray.Instance.GetCfg(180004));
+            }
+            else
+            {
+                PhotographSceneManager.Instance.AddBgItem(ItemCfgArray.Instance.GetCfg(MatchingRightDataManager.Instance.DressUpBgID));
+            }
+            PhotographSceneManager.Instance.AddBodyItem();
+            GameObject bodyParent = _sceneObjectRight.transform.Find("Scene/Role").gameObject;
+            PhotographDataManager.Instance.dressUpObj.setSceneObj(_sceneObjectRight, false, true, bodyParent, false, null);
+            PhotographDataManager.Instance.dressUpObj.PutOnDressUpData(MatchingRightDataManager.Instance.MathingDressDate);
+
+            //对搭配赛特殊处理
+            for (int i = 0; i < MatchingRightDataManager.Instance.DressPropIdList.Count; i++)
+            {
+                if (MatchingRightDataManager.Instance.DressPropIdList[i] <= 0)
+                {
+                    continue;
+                }
+                else
+                {
+                    ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(MatchingRightDataManager.Instance.DressPropIdList[i]);
+                    MatchingCompetitionDataManager.Instance.AddSceneItem(itemCfg, true,2);
+                }
+            }
+            await Task.Delay(100);
+            MatchingRightDataManager.Instance.InsertGameObjectList();
+            for (int i = 0; i < MatchingRightDataManager.Instance.TransformDataList.Count; i++)
+            {
+                TransformData itemdata = MatchingRightDataManager.Instance.TransformDataList[i];
+                GameObject itemGObj = MatchingRightDataManager.Instance.itemGameObjs[i];
+                MatchingRightDataManager.Instance.itemGameObjs[i].transform.position = itemdata.position;
+                MatchingRightDataManager.Instance.itemGameObjs[i].transform.Rotate(itemGObj.transform.eulerAngles.x, itemGObj.transform.eulerAngles.y, itemdata.rotationZ);
+                MatchingRightDataManager.Instance.itemGameObjs[i].transform.localScale = itemdata.scale;
+                PhotographUtil.Instance.ChangeLayer(MatchingRightDataManager.Instance.itemGameObjs[i], i * PhotographDataManager.layerCount, "up");
+            }
+            _sceneObjectRight.transform.position = new Vector3(50, 50, 50);
+            await Task.Delay(100);
+            UpdatePlayer();
         }
+        private RenderTexture renderTexureLeft;
+        private RenderTexture renderTexureRight;
         private void UpdatePlayer()
         {
-            _ui.m_playerShow1.m_playerImage.m_playerImage.texture = MatchingTwoDataManager.Instance.LeftRoleInfo.Ntexture;
-            _ui.m_playerShow2.m_playerImage.m_playerImage.texture = MatchingTwoDataManager.Instance.RightRoleInfo.Ntexture;
-            MatchingPhotoWorksData otherLeftdata = MatchingTwoDataManager.Instance.LeftRoleInfo;
+            _ui.m_playerShow1.m_playerImage.m_playerImage.texture = new NTexture(renderTexureLeft);
+            _ui.m_playerShow2.m_playerImage.m_playerImage.texture = new NTexture(renderTexureRight);
+            MatchingPhotoWorksData otherLeftdata = MatchingLeftDataManager.Instance.LeftRoleInfo;
             JudgingRoundRoleInfo otherLeftInfo = otherLeftdata.JudgingInfo;
             RoleInfoManager.Instance.UpdateHead(_ui.m_player1.m_head, otherLeftInfo.HeadItemId, otherLeftInfo.HeadBorderItemId);
             _ui.m_player1.m_nameText.text = otherLeftInfo.RoleName.ToString();
             _ui.m_select1.m_numText.visible = false;
             _ui.m_select1.m_numText.text = otherLeftInfo.Score.ToString();
-            MatchingPhotoWorksData otherRightdata = MatchingTwoDataManager.Instance.RightRoleInfo;
+            MatchingPhotoWorksData otherRightdata = MatchingRightDataManager.Instance.RightRoleInfo;
             JudgingRoundRoleInfo otherRightInfo = otherRightdata.JudgingInfo;
             RoleInfoManager.Instance.UpdateHead(_ui.m_player2.m_head, otherRightInfo.HeadItemId, otherRightInfo.HeadBorderItemId);
             _ui.m_player2.m_nameText.text = otherRightInfo.RoleName.ToString();
             _ui.m_select2.m_numText.visible = false;
             _ui.m_select2.m_numText.text = otherRightInfo.Score.ToString();
+            ViewManager.Hide<ModalStatusView>();
         }
         private void UpdateView()
         {
@@ -97,14 +249,14 @@ namespace GFGGame
                 return;
             }
             bool result = await MatchingCompetitionSproxy.ReqCheckMatchingCompetitionWork(
-                MatchingTwoDataManager.Instance.LeftRoleInfo.JudgingInfo.WorksId,MatchingTwoDataManager.Instance.RightRoleInfo.JudgingInfo.WorksId
+                MatchingLeftDataManager.Instance.LeftRoleInfo.JudgingInfo.WorksId,MatchingRightDataManager.Instance.RightRoleInfo.JudgingInfo.WorksId
                 ) ;
             if(result)
             {
                 _ui.m_select1.m_c1.selectedIndex = 1;
                 _ui.m_select1.m_numText.visible = true;
                 _ui.m_select2.m_numText.visible = true;
-                _ui.m_select1.m_numText.text = string.Format("心动值{0}", MatchingTwoDataManager.Instance.LeftRoleInfo.JudgingInfo.Score.ToString());
+                _ui.m_select1.m_numText.text = string.Format("心动值{0}", MatchingLeftDataManager.Instance.LeftRoleInfo.JudgingInfo.Score.ToString());
                 _ui.m_timeText.text = string.Format("剩余次数:{0}", MatchingCompetitionDataManager.Instance.MatchingRemainingTimes);
             }
             _ui.m_t0.Play(async () =>
@@ -112,8 +264,18 @@ namespace GFGGame
                 bool resulst = await MatchingCompetitionSproxy.ReqGetTwoPlayers();
                 if (resulst)
                 {
+                    if (_sceneObjectLeft != null)
+                    {
+                        PrefabManager.Instance.Restore(_sceneObjectLeft);
+                        _sceneObjectLeft = null;
+                    }
+                    if (_sceneObjectRight != null)
+                    {
+                        PrefabManager.Instance.Restore(_sceneObjectRight);
+                        _sceneObjectRight = null;
+                    }
+                    UpdateDressLeft();
                     UpdateView();
-                    UpdatePlayer();
                 }
             });
         }
@@ -125,14 +287,14 @@ namespace GFGGame
                 return;
             }
             bool result = await MatchingCompetitionSproxy.ReqCheckMatchingCompetitionWork(
-                            MatchingTwoDataManager.Instance.RightRoleInfo.JudgingInfo.WorksId, MatchingTwoDataManager.Instance.LeftRoleInfo.JudgingInfo.WorksId
+                            MatchingRightDataManager.Instance.RightRoleInfo.JudgingInfo.WorksId, MatchingLeftDataManager.Instance.LeftRoleInfo.JudgingInfo.WorksId
                             );
             if (result)
             {
                 _ui.m_select2.m_c1.selectedIndex = 1;
                 _ui.m_select1.m_numText.visible = true;
                 _ui.m_select2.m_numText.visible = true;
-                _ui.m_select2.m_numText.text = string.Format("心动值{0}", MatchingTwoDataManager.Instance.RightRoleInfo.JudgingInfo.Score.ToString());
+                _ui.m_select2.m_numText.text = string.Format("心动值{0}", MatchingRightDataManager.Instance.RightRoleInfo.JudgingInfo.Score.ToString());
                 _ui.m_timeText.text = string.Format("剩余次数:{0}", MatchingCompetitionDataManager.Instance.MatchingRemainingTimes);
             }
             _ui.m_t1.Play(async () => 
@@ -140,8 +302,18 @@ namespace GFGGame
                 bool resulst = await MatchingCompetitionSproxy.ReqGetTwoPlayers();
                 if (resulst)
                 {
+                    if (_sceneObjectLeft != null)
+                    {
+                        PrefabManager.Instance.Restore(_sceneObjectLeft);
+                        _sceneObjectLeft = null;
+                    }
+                    if (_sceneObjectRight != null)
+                    {
+                        PrefabManager.Instance.Restore(_sceneObjectRight);
+                        _sceneObjectRight = null;
+                    }
+                    UpdateDressLeft();
                     UpdateView();
-                    UpdatePlayer();
                 }
             });
         }

+ 16 - 11
GameClient/Assets/Game/HotUpdate/Views/MatchingCompetition/MatchingCompetitionUpLoadView.cs

@@ -84,7 +84,7 @@ namespace GFGGame
         }
         private async void UpdateDress()
         {
-            if (MatchingOneDataManager.Instance.MathingDressDate.actionId != 0)
+            //if (MatchingOneDataManager.Instance.MathingDressDate.actionId != 0)
             {
                 _ui.m_bg.visible = false;
                 _ui.m_playerImage.visible = false;
@@ -119,7 +119,7 @@ namespace GFGGame
                     }
                     else
                     {
-                        ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(MatchingCompetitionDataManager.Instance.DressPropIdList[i]);
+                        ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(MatchingOneDataManager.Instance.DressPropIdList[i]);
                         MatchingCompetitionDataManager.Instance.AddSceneItem(itemCfg, true);
                     }
                 }
@@ -135,12 +135,12 @@ namespace GFGGame
                     PhotographUtil.Instance.ChangeLayer(MatchingOneDataManager.Instance.itemGameObjs[i], i * PhotographDataManager.layerCount, "up");
                 }
             }
-            else
-            {
-                _ui.m_bg.visible = true;
-                _ui.m_playerImage.visible = true;
-                _ui.m_playerImage.texture = MatchingOneDataManager.Instance.OneRoleInfo.Ntexture;
-            }
+            //else
+            //{
+            //    _ui.m_bg.visible = true;
+            //    _ui.m_playerImage.visible = true;
+            //    _ui.m_playerImage.texture = MatchingOneDataManager.Instance.OneRoleInfo.Ntexture;
+            //}
         }
         private void UpdateView()
         {
@@ -258,16 +258,21 @@ namespace GFGGame
             _ui.m_countTime.visible = true;
             _ui.m_countTime.fillAmount = 1.0f;
             Timers.inst.AddUpdate(UpdateCountTime);
-            ViewManager.Show<ModalStatusView>("刷新中...");
+            //ViewManager.Show<ModalStatusView>("刷新中...");
             bool result = await MatchingCompetitionSproxy.ReqGetOnePlayers();
             if (result)
             {
+                if (_sceneObject != null)
+                {
+                    PrefabManager.Instance.Restore(_sceneObject);
+                    _sceneObject = null;
+                }
                 //UpdateView();
                 UpdateHead();
                 UpdateDress();
-                ViewManager.Hide<ModalStatusView>();
+                //ViewManager.Hide<ModalStatusView>();
             }
-            ViewManager.Hide<ModalStatusView>();
+            //ViewManager.Hide<ModalStatusView>();
         }
         private void OnClickBtnLook()
         {

+ 83 - 3
GameClient/Assets/ResIn/Prefab/ScenePhotograph.prefab

@@ -1,5 +1,84 @@
 %YAML 1.1
 %TAG !u! tag:unity3d.com,2011:
+--- !u!1 &1676607243667215494
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 6674501151243515770}
+  - component: {fileID: 3400994236161160953}
+  m_Layer: 0
+  m_Name: Camera
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 0
+--- !u!224 &6674501151243515770
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1676607243667215494}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: -5.49}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children: []
+  m_Father: {fileID: 8933042271082668914}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: -0.5, y: 2.3}
+  m_SizeDelta: {x: 100, y: 100}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!20 &3400994236161160953
+Camera:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1676607243667215494}
+  m_Enabled: 1
+  serializedVersion: 2
+  m_ClearFlags: 2
+  m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0}
+  m_projectionMatrixMode: 1
+  m_GateFitMode: 2
+  m_FOVAxisMode: 0
+  m_SensorSize: {x: 36, y: 24}
+  m_LensShift: {x: 0, y: 0}
+  m_FocalLength: 50
+  m_NormalizedViewPortRect:
+    serializedVersion: 2
+    x: 0
+    y: 0
+    width: 1
+    height: 1
+  near clip plane: -1
+  far clip plane: 1000
+  field of view: 60
+  orthographic: 1
+  orthographic size: 9.6
+  m_Depth: -1
+  m_CullingMask:
+    serializedVersion: 2
+    m_Bits: 23
+  m_RenderingPath: -1
+  m_TargetTexture: {fileID: 0}
+  m_TargetDisplay: 0
+  m_TargetEye: 0
+  m_HDR: 1
+  m_AllowMSAA: 0
+  m_AllowDynamicResolution: 0
+  m_ForceIntoRT: 0
+  m_OcclusionCulling: 0
+  m_StereoConvergence: 10
+  m_StereoSeparation: 0.022
 --- !u!1 &3726009262938659745
 GameObject:
   m_ObjectHideFlags: 0
@@ -29,7 +108,7 @@ Transform:
   m_Children:
   - {fileID: 2394733109435034269}
   m_Father: {fileID: 8933042271082668914}
-  m_RootOrder: 2
+  m_RootOrder: 3
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &4573956036435348681
 GameObject:
@@ -225,7 +304,7 @@ Transform:
   - {fileID: 177624320223164717}
   - {fileID: 1387909070457341848}
   m_Father: {fileID: 8933042271082668914}
-  m_RootOrder: 1
+  m_RootOrder: 2
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &6507681665420882922
 GameObject:
@@ -317,7 +396,7 @@ Transform:
   m_Children:
   - {fileID: 8924633051995509692}
   m_Father: {fileID: 8933042271082668914}
-  m_RootOrder: 0
+  m_RootOrder: 1
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &8933042271082668915
 GameObject:
@@ -346,6 +425,7 @@ Transform:
   m_LocalPosition: {x: 0, y: 0, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children:
+  - {fileID: 6674501151243515770}
   - {fileID: 7675319647472965112}
   - {fileID: 5810125597218964383}
   - {fileID: 7620177300938337219}

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