Explorar o código

修改服装合成的穿脱选中逻辑

leiyasi hai 1 ano
pai
achega
92156fb987

+ 8 - 5
GameClient/Assets/Game/HotUpdate/Views/ClothingSynthetic/ClothingSyntheticView.cs

@@ -171,7 +171,8 @@ namespace GFGGame
             }
 
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_selectedItemId);
-            if (itemCfg == null) { 
+            if (itemCfg == null)
+            {
                 ET.Log.Error("OnClickBtnProcuction itemCfg is null");
                 return;
             }
@@ -228,9 +229,11 @@ namespace GFGGame
             // 平板会比宽手机更宽,设定最小值防止缩小
             rate = Mathf.Max(rate, 1);
 
+            _dressUpObjUI.dressUpObj.TakeOffAll();
             _dressUpObjUI.ResetSceneObj(45, true, true, null, false);
-            _dressUpObjUI.dressUpObj.AddOrRemove(_selectedItemId, true);
-            _imgSelected.visible = true;// _dressUpObjUI.dressUpObj.CheckDressUpItemIsOn(_selectedItemId);
+            _dressUpObjUI.dressUpObj.AddOrRemove(_selectedItemId, true, DressUpOption.Add);
+            //_imgSelected.visible = _dressUpObjUI.dressUpObj.CheckDressUpItemIsOn(_selectedItemId);
+            _imgSelected.visible = true;
             _dressUpObjUI.UpdateWrapper(_compMover.m_holder);
             int type = ItemUtilCS.GetItemSubType(_selectedItemId);
             float duration = DURATION;
@@ -253,13 +256,13 @@ namespace GFGGame
             else if (Array.IndexOf(UPPER_BODY_Y_ARR, type) >= 0)
             {
                 _ui.m_compHolder.m_compHolder.m_compMover.target.TweenMoveY(UPPER_BODY_Y + dy, duration).SetEase(ease);
-                _compMover.target.TweenScale(new Vector2(UPPER_BODY_SCALE* rate, UPPER_BODY_SCALE * rate), duration).SetEase(ease);
+                _compMover.target.TweenScale(new Vector2(UPPER_BODY_SCALE * rate, UPPER_BODY_SCALE * rate), duration).SetEase(ease);
             }
             else if (Array.IndexOf(LOWER_BODY_Y_ARR, type) >= 0)
             {
                 _ui.m_loaBg2.visible = true;
                 _compMover.target.TweenMoveY(LOWER_BODY_Y + dy, duration).SetEase(ease);
-                _compMover.target.TweenScale(new Vector2(LOWER_BODY_SCALE * rate, LOWER_BODY_SCALE* rate), duration).SetEase(ease);
+                _compMover.target.TweenScale(new Vector2(LOWER_BODY_SCALE * rate, LOWER_BODY_SCALE * rate), duration).SetEase(ease);
             }
             else if (Array.IndexOf(SHOES_Y_ARR, type) >= 0)
             {