Переглянути джерело

养护服装展示bug,集齐套装服装展示bug

HDY 4 місяців тому
батько
коміт
a85d1e0c12

+ 20 - 2
GameClient/Assets/Game/HotUpdate/Views/ClothingFoster/ClothingView.cs

@@ -24,6 +24,7 @@ namespace GFGGame
         private int _index;
         private int _index;
 
 
         private bool _canRenew;
         private bool _canRenew;
+        private bool touchClick = true;
 
 
         public override void Dispose()
         public override void Dispose()
         {
         {
@@ -63,7 +64,7 @@ namespace GFGGame
             isReturnView = true;
             isReturnView = true;
             // this.clickBlankToClose = false;
             // this.clickBlankToClose = false;
             _valueBarController = new ValueBarController(_ui.m_valueBar);
             _valueBarController = new ValueBarController(_ui.m_valueBar);
-            _dressUpObjUI = new DressUpObjUI("SceneSuitFoster");
+            //_dressUpObjUI = new DressUpObjUI("SceneSuitFoster");
 
 
             _ui.m_btnBack.onClick.Add(OnClickBtnBack);
             _ui.m_btnBack.onClick.Add(OnClickBtnBack);
             _ui.m_comRenewReward.target.onClick.Add(OnClickRenewRewardItem);
             _ui.m_comRenewReward.target.onClick.Add(OnClickRenewRewardItem);
@@ -125,6 +126,7 @@ namespace GFGGame
             base.OnHide();
             base.OnHide();
             _valueBarController.OnHide();
             _valueBarController.OnHide();
             Timers.inst.Remove(CheckGuide);
             Timers.inst.Remove(CheckGuide);
+            Timers.inst.Remove(OnTimerUpDate);
         }
         }
 
 
         protected override void RemoveEventListener()
         protected override void RemoveEventListener()
@@ -172,12 +174,25 @@ namespace GFGGame
             _ui.m_btnLeft.visible = (index - 1 >= 0);
             _ui.m_btnLeft.visible = (index - 1 >= 0);
         }
         }
 
 
+        private void OnTimerUpDate(object param = null)
+        {
+            touchClick = true;
+            _dressUpObjUI.UpdateWrapper(_ui.m_holder);
+        }
 
 
         private void UpdateSuitView(bool isPic = true)
         private void UpdateSuitView(bool isPic = true)
         {
         {
             SuitCfg suitCfg = CommonDataManager.Tables.TblSuitCfg.GetOrDefault(_suitId);
             SuitCfg suitCfg = CommonDataManager.Tables.TblSuitCfg.GetOrDefault(_suitId);
             _ui.m_txtName.text = suitCfg.Name;
             _ui.m_txtName.text = suitCfg.Name;
 
 
+            if (_dressUpObjUI != null)
+            {
+                _dressUpObjUI.Dispose();
+                _dressUpObjUI = null;
+            }
+
+            _dressUpObjUI = new DressUpObjUI("SceneSuitFoster");
+
             // 使用异步方式重置场景对象
             // 使用异步方式重置场景对象
             _dressUpObjUI.ResetSceneObjAsync(100, false, true, null, false, (sceneObj) =>
             _dressUpObjUI.ResetSceneObjAsync(100, false, true, null, false, (sceneObj) =>
             {
             {
@@ -185,7 +200,8 @@ namespace GFGGame
                 {
                 {
                     // 场景对象加载完成后穿上套装
                     // 场景对象加载完成后穿上套装
                     _dressUpObjUI.dressUpObj.PutOnSuitCfg(_suitId, isPic, new int[] { ConstDressUpItemType.BEI_JING });
                     _dressUpObjUI.dressUpObj.PutOnSuitCfg(_suitId, isPic, new int[] { ConstDressUpItemType.BEI_JING });
-                    _dressUpObjUI.UpdateWrapper(_ui.m_holder);
+                    Timers.inst.Add(1f, 1, OnTimerUpDate);
+
                 }
                 }
                 else
                 else
                 {
                 {
@@ -196,6 +212,8 @@ namespace GFGGame
 
 
         private void OnClickBtnDirection(int direction)
         private void OnClickBtnDirection(int direction)
         {
         {
+            if (!touchClick) return;
+            touchClick = false;
             int index = _suitIds.IndexOf(_suitId);
             int index = _suitIds.IndexOf(_suitId);
             int targetIndex = index + direction;
             int targetIndex = index + direction;
             if (targetIndex >= 0 && direction == -1 || targetIndex < _suitIds.Count && direction == 1)
             if (targetIndex >= 0 && direction == -1 || targetIndex < _suitIds.Count && direction == 1)

+ 9 - 1
GameClient/Assets/Game/HotUpdate/Views/CommonGame/GetSuitItemVIew.cs

@@ -45,7 +45,7 @@ namespace GFGGame
             this.viewCom = _ui.target;
             this.viewCom = _ui.target;
             isfullScreen = true;
             isfullScreen = true;
 
 
-            _dressUpObjUI = new DressUpObjUI("SceneDressUp", onShowAction);
+            //_dressUpObjUI = new DressUpObjUI("SceneDressUp", onShowAction);
             _ui.m_loaBg.onClick.Add(OnClickBg);
             _ui.m_loaBg.onClick.Add(OnClickBg);
             _ui.m_btnShare.onClick.Add(OnClickShare);
             _ui.m_btnShare.onClick.Add(OnClickShare);
 
 
@@ -171,6 +171,14 @@ namespace GFGGame
             bool showAction = SuitCfgArray.Instance.CheckSuitHasAction(suitId) &&
             bool showAction = SuitCfgArray.Instance.CheckSuitHasAction(suitId) &&
                               DressUpMenuSuitDataManager.CheckSuitHasActionRes(suitId);
                               DressUpMenuSuitDataManager.CheckSuitHasActionRes(suitId);
 
 
+            if (_dressUpObjUI != null)
+            {
+                _dressUpObjUI.Dispose();
+                _dressUpObjUI = null;
+            }
+
+            _dressUpObjUI = new DressUpObjUI("SceneDressUp", onShowAction);
+
             // 使用异步方式重置场景对象
             // 使用异步方式重置场景对象
             _dressUpObjUI.ResetSceneObjAsync(
             _dressUpObjUI.ResetSceneObjAsync(
                 115,
                 115,