zhaoyang 2 anos atrás
pai
commit
6bedd7864c

+ 8 - 4
GameClient/Assets/Game/HotUpdate/DressUp/DressUpObjDataCache.cs

@@ -537,7 +537,7 @@ namespace GFGGame
             }
         }
 
-        public void PutOnSuitCfg(int id, bool checkPic, bool noSceneType, int[] excludeType = null)
+        public void PutOnSuitCfg(int id, bool checkPic, bool noSceneType, int[] excludeType = null, bool showOptional = true, bool CheckOwn = true)
         {
             if (_suitId == id)
             {
@@ -548,14 +548,18 @@ namespace GFGGame
             _isPic = HasSuitPicRes && checkPic;
             SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(_suitId);
             List<int> items = new List<int>(suitCfg.partsArr);
-            if (suitCfg.partsOptionalArr != null && suitCfg.partsOptionalArr.Length > 0)
+            if(showOptional)
             {
-                items.AddRange(suitCfg.partsOptionalArr);
+
+                if (suitCfg.partsOptionalArr != null && suitCfg.partsOptionalArr.Length > 0)
+                {
+                    items.AddRange(suitCfg.partsOptionalArr);
+                }
             }
             int subType = 0;
             foreach (int itemID in items)
             {
-                if (DressUpMenuItemDataManager.CheckHasItem(itemID))
+                if (!CheckOwn || DressUpMenuItemDataManager.CheckHasItem(itemID))
                 {
                     bool isSceneType = DressUpMenuItemDataManager.CheckIsSceneType(itemID);
                     subType = ItemUtilCS.GetItemSubType(itemID);

+ 11 - 3
GameClient/Assets/Game/HotUpdate/Views/CommonGame/GetSuitItemVIew.cs

@@ -13,6 +13,7 @@ namespace GFGGame
         private GoWrapper _wrapper;
         private GameObject _gameObject1;
         private GoWrapper _wrapper1;
+        private DressUpObjDataCache _dressUpObjDataCache;
 
         private int guideId = 0;//0:没有引导 1:首次获得套装2:首次获得套装部件
         public override void Dispose()
@@ -30,6 +31,11 @@ namespace GFGGame
                 _wrapper = null;
             }
 
+            if (_dressUpObjDataCache != null)
+            {
+                _dressUpObjDataCache.Dispose();
+                _dressUpObjDataCache = null;
+            }
             if (_ui != null)
             {
                 _ui.Dispose();
@@ -46,6 +52,7 @@ namespace GFGGame
             isfullScreen = true;
 
             _scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath("SceneDressUp"));
+            _dressUpObjDataCache = new DressUpObjDataCache();
             _ui.m_bg.onClick.Add(OnClickBg);
 
             string resPath = ResPathUtil.GetViewEffectPath("ui_ck", "ui_ck_tz");
@@ -128,10 +135,8 @@ namespace GFGGame
             int count = 0;//套装当前拥有的部件数量
             int totalCount = 1;
             // int suitId = 0;
-            int[] itemIds = null;
             DressUpMenuSuitDataManager.GetSuitProgressBySuitId(suitId, out count, out totalCount);
             // totalCount = SuitCfgManager.Instance.GetTotalCountOfOneSuit(suitId);
-            itemIds = SuitCfgManager.Instance.GetSuitItems(suitId);
             if (suitId > 0)
             {
                 SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(suitId);
@@ -157,7 +162,10 @@ namespace GFGGame
             _sceneObject = GameObject.Instantiate(_scenePrefab);
             int scale = 70;
             _sceneObject.transform.localScale = new Vector3(scale, scale, scale);
-            SceneController.UpdateRole(itemIds, _sceneObject);
+
+            _dressUpObjDataCache.setSceneObj(_sceneObject);
+            _dressUpObjDataCache.PutOnDefaultSuitSaved(false);
+            _dressUpObjDataCache.PutOnSuitCfg(suitId, false, false, new int[] { ConstDressUpItemType.BEI_JING }, false, false);
             if (_wrapper == null)
             {
                 _wrapper = new GoWrapper(_sceneObject);