Browse Source

Merge branch 'master' of http://10.108.64.190:3000/gfg/client

beiguoxia 1 year ago
parent
commit
21f1227e7d

+ 5 - 0
GameClient/Assets/Game/HotUpdate/Data/BagDataManager.cs

@@ -81,5 +81,10 @@ namespace GFGGame
                 return 0;
                 return 0;
             }
             }
         }
         }
+
+        public Dictionary<int, ItemData> GetBagData() 
+        {
+            return _bagDataDic;
+        }
     }
     }
 }
 }

+ 33 - 7
GameClient/Assets/Game/HotUpdate/Data/DecomposeDataManager.cs

@@ -43,6 +43,11 @@ namespace GFGGame
                         if (materiarsCount> 0 && (materiarsCount + materiars[1] - DeductSynthesisNeedNum(materialId)) > 0)
                         if (materiarsCount> 0 && (materiarsCount + materiars[1] - DeductSynthesisNeedNum(materialId)) > 0)
                         {
                         {
                             rarity = ItemDataManager.GetItemRarity(materialId);
                             rarity = ItemDataManager.GetItemRarity(materialId);
+                            if (!_decomposeData.ContainsKey(rarity))
+                            {
+                                _decomposeData.Add(rarity, new List<int>());
+                            }
+
                             if (_decomposeData[rarity].IndexOf(materialId) < 0)
                             if (_decomposeData[rarity].IndexOf(materialId) < 0)
                             {
                             {
                                 _decomposeData[rarity].Add(materialId);
                                 _decomposeData[rarity].Add(materialId);
@@ -111,13 +116,6 @@ namespace GFGGame
             return sum;
             return sum;
         }
         }
 
 
-        public List<int> GetDecomposeDataByRarity(int rarity)
-        {
-            if (!_decomposeData.ContainsKey(rarity)) return null;
-            return _decomposeData[rarity];
-        }
-
-
         public List<int> GetRewardList()
         public List<int> GetRewardList()
         {
         {
             if (_rewardList.Count == 0)
             if (_rewardList.Count == 0)
@@ -165,6 +163,34 @@ namespace GFGGame
             return ItemDataManager.GetItemNum(itemId) - synthesisNum;
             return ItemDataManager.GetItemNum(itemId) - synthesisNum;
         }
         }
 
 
+        //整理分解物品数据
+        public void TidyDecomposeData()
+        {
+            foreach (var itemId in DressUpMenuItemDataManager.GetDressUpItemDatas())
+            {
+                if (!DressUpMenuItemCfg1Array.Instance.CheckIsBackGroundType(itemId))
+                {
+                    Add(itemId);
+                }
+            }
+
+            foreach (var info in BagDataManager.Instance.GetBagData())
+            {
+                if (info.Value.itemType == ConstItemType.ITEM && info.Value.subType == ConstItemSubType.MATERIAL_SKILL_BOOK)
+                {
+                    AddMaterial(info.Value.id);
+                }
+            }
+        }
+
+        //获得分解服装数据
+        public List<int> GetDecomposeDataByRarity(int rarity)
+        {
+            if (!_decomposeData.ContainsKey(rarity)) return null;
+            return _decomposeData[rarity];
+        }
+
+        //获得分解技能书数据
         public List<int> GetDecomposeMaterialByRarity(int rarity)
         public List<int> GetDecomposeMaterialByRarity(int rarity)
         {
         {
             if (!_decomposeMaterialData.ContainsKey(rarity)) return null;
             if (!_decomposeMaterialData.ContainsKey(rarity)) return null;

+ 5 - 0
GameClient/Assets/Game/HotUpdate/Data/DressUpMenuItemDataManager.cs

@@ -86,6 +86,11 @@ namespace GFGGame
             return _itemDatas.Contains(itemID);
             return _itemDatas.Contains(itemID);
         }
         }
 
 
+        public static List<int> GetDressUpItemDatas()
+        {
+            return _itemDatas;
+        }
+
         public static void Remove(int value)
         public static void Remove(int value)
         {
         {
             if (_itemDatas == null)
             if (_itemDatas == null)

+ 0 - 10
GameClient/Assets/Game/HotUpdate/Data/ItemDataManager.cs

@@ -39,10 +39,6 @@ namespace GFGGame
             if (itemInfoProto.Type == ConstItemType.DRESS_UP && itemID % GameConst.MAX_COUNT_EVERY_TYPE_ITEM > 0)
             if (itemInfoProto.Type == ConstItemType.DRESS_UP && itemID % GameConst.MAX_COUNT_EVERY_TYPE_ITEM > 0)
             {
             {
                 DressUpMenuItemDataManager.Add(itemInfoProto);
                 DressUpMenuItemDataManager.Add(itemInfoProto);
-                if (!DressUpMenuItemCfg1Array.Instance.CheckIsBackGroundType(itemInfoProto))
-                {
-                    DecomposeDataManager.Instance.Add(itemID);
-                }
 
 
                 //游戏角色初始数据完成后才执行
                 //游戏角色初始数据完成后才执行
                 if (GameGlobal.DataInited)
                 if (GameGlobal.DataInited)
@@ -56,17 +52,11 @@ namespace GFGGame
                         FunctionOpenDataManager.Instance.CheckHasSpecialFunOpen();
                         FunctionOpenDataManager.Instance.CheckHasSpecialFunOpen();
                     }
                     }
                 }
                 }
-                    
             }
             }
             if ((itemInfoProto.Type == ConstItemType.ITEM || itemInfoProto.Type == ConstItemType.USEABLE) &&
             if ((itemInfoProto.Type == ConstItemType.ITEM || itemInfoProto.Type == ConstItemType.USEABLE) &&
                 itemData.num > 0)
                 itemData.num > 0)
             {
             {
                 BagDataManager.Instance.Add(itemData);
                 BagDataManager.Instance.Add(itemData);
-
-                if (itemInfoProto.Type == ConstItemType.ITEM && itemInfoProto.SubType == ConstItemSubType.MATERIAL_SKILL_BOOK)
-                {
-                    DecomposeDataManager.Instance.AddMaterial(itemID);
-                }
             }
             }
 
 
             if (itemInfoProto.Type == ConstItemType.HEAD)
             if (itemInfoProto.Type == ConstItemType.HEAD)

+ 2 - 1
GameClient/Assets/Game/HotUpdate/DressUp/DressUpLayerOperation.cs

@@ -270,7 +270,8 @@ namespace GFGGame
                 DressUpUtil.AddSpriteObj(this.resPath, spritObjName, parentObj, sortingOrder, needSetMask);
                 DressUpUtil.AddSpriteObj(this.resPath, spritObjName, parentObj, sortingOrder, needSetMask);
                 if (removeBodyAni)
                 if (removeBodyAni)
                 {
                 {
-                    parentObj.transform.SetPositionAndRotation(Vector3.zero, Quaternion.identity); 
+                    parentObj.transform.localPosition = Vector3.zero;
+                    parentObj.transform.localRotation = Quaternion.identity;
                 }
                 }
             }
             }
             if (!string.IsNullOrEmpty(effectResPath))
             if (!string.IsNullOrEmpty(effectResPath))

+ 2 - 1
GameClient/Assets/Game/HotUpdate/DressUp/DressUpUtil.cs

@@ -331,7 +331,8 @@ namespace GFGGame
                     dressUpBodyOffsetInfo.Rotation = gameObj.transform.localRotation;
                     dressUpBodyOffsetInfo.Rotation = gameObj.transform.localRotation;
                 }
                 }
                 //如果是动作动画,就根据动画位置及角度信息设置给Role对象
                 //如果是动作动画,就根据动画位置及角度信息设置给Role对象
-                parentObj.transform.SetPositionAndRotation(dressUpBodyOffsetInfo.OffsetPosition, dressUpBodyOffsetInfo.Rotation);
+                parentObj.transform.localPosition = dressUpBodyOffsetInfo.OffsetPosition;
+                parentObj.transform.rotation = dressUpBodyOffsetInfo.Rotation;
                 gameObj.transform.localPosition = Vector3.zero;
                 gameObj.transform.localPosition = Vector3.zero;
                 gameObj.transform.rotation = Quaternion.identity;
                 gameObj.transform.rotation = Quaternion.identity;
                 //.SetPositionAndRotation(Vector3.zero, Quaternion.identity); 
                 //.SetPositionAndRotation(Vector3.zero, Quaternion.identity); 

+ 8 - 6
GameClient/Assets/Game/HotUpdate/Views/ClothingDecompose/ClothingDecomposeView.cs

@@ -86,17 +86,18 @@ namespace GFGGame
         protected override void OnShown()
         protected override void OnShown()
         {
         {
             base.OnShown();
             base.OnShown();
+            DecomposeDataManager.Instance.TidyDecomposeData();
             _ui.m_c1.selectedIndex = 0;
             _ui.m_c1.selectedIndex = 0;
             _ui.m_listTab.selectedIndex = 0;
             _ui.m_listTab.selectedIndex = 0;
 
 
             _valueBarController.OnShown();
             _valueBarController.OnShown();
             // _valueBarController.Controller(6);
             // _valueBarController.Controller(6);
             OnClickBtnRarity(ConstDressRarity.Rarity_FANPIN);
             OnClickBtnRarity(ConstDressRarity.Rarity_FANPIN);
-            if (GuideDataManager.currentGuideId == GuideCfgArray.Instance.GetCfg(ConstGuideId.CLOTHING_DECOMPOSE).id)
-            {
-                _ui.m_listTab.selectedIndex = 0;
-                OnClickBtnRarity(ConstDressRarity.Rarity_FANPIN);
-            }
+            //if (GuideDataManager.currentGuideId == GuideCfgArray.Instance.GetCfg(ConstGuideId.CLOTHING_DECOMPOSE).id)
+            //{
+            //    _ui.m_listTab.selectedIndex = 0;
+            //    OnClickBtnRarity(ConstDressRarity.Rarity_FANPIN);
+            //}
             Timers.inst.AddUpdate(CheckGuide);
             Timers.inst.AddUpdate(CheckGuide);
         }
         }
 
 
@@ -110,7 +111,7 @@ namespace GFGGame
         private void OnClickBtnRarity(int rarity)
         private void OnClickBtnRarity(int rarity)
         {
         {
             _curRarity = rarity;
             _curRarity = rarity;
-            if(_ui.m_c1.selectedIndex == 0)
+            if (_ui.m_c1.selectedIndex == 0)
                 _clothingDatas = DecomposeDataManager.Instance.GetDecomposeDataByRarity(rarity);
                 _clothingDatas = DecomposeDataManager.Instance.GetDecomposeDataByRarity(rarity);
             else if (_ui.m_c1.selectedIndex == 1)
             else if (_ui.m_c1.selectedIndex == 1)
                 _clothingDatas = DecomposeDataManager.Instance.GetDecomposeMaterialByRarity(rarity);
                 _clothingDatas = DecomposeDataManager.Instance.GetDecomposeMaterialByRarity(rarity);
@@ -126,6 +127,7 @@ namespace GFGGame
         private void ListItemRander(int index, GObject obj) 
         private void ListItemRander(int index, GObject obj) 
         {
         {
             UI_ComItem item = UI_ComItem.Proxy(obj);
             UI_ComItem item = UI_ComItem.Proxy(obj);
+
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_clothingDatas[index]);
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_clothingDatas[index]);
             RarityIconController.UpdateRarityIcon(item.m_loaRarity, itemCfg.id, false);
             RarityIconController.UpdateRarityIcon(item.m_loaRarity, itemCfg.id, false);
             string ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true);
             string ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true);

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Common/Controller/LuckyBoxController.cs

@@ -109,7 +109,7 @@ namespace GFGGame
         {
         {
             _bgIndex = 0;
             _bgIndex = 0;
             _modelIndex = 0;
             _modelIndex = 0;
-            _dressUpObjUI.ResetSceneObj(0, false, false, null, false);
+            _dressUpObjUI.dressUpObj.TakeOffAll();
             UI_ComModel _comModel = UI_ComModel.Proxy(_com);
             UI_ComModel _comModel = UI_ComModel.Proxy(_com);
             _comModel.m_comModelRes.m_loaRes.url = "";
             _comModel.m_comModelRes.m_loaRes.url = "";
             UI_ComModel.ProxyEnd();
             UI_ComModel.ProxyEnd();