Browse Source

套装养成属性展示

zhaoyang 3 years ago
parent
commit
57f09dcd80

+ 14 - 3
GameClient/Assets/Game/HotUpdate/Views/ClothingFoster/SuitPropertyShowView.cs

@@ -1,3 +1,4 @@
+using System.Collections.Generic;
 using FairyGUI;
 using FairyGUI;
 using UI.ClothingFoster;
 using UI.ClothingFoster;
 namespace GFGGame
 namespace GFGGame
@@ -5,7 +6,7 @@ namespace GFGGame
     public class SuitPropertyShowView : BaseWindow
     public class SuitPropertyShowView : BaseWindow
     {
     {
         private UI_SuitPropertyShowUI _ui;
         private UI_SuitPropertyShowUI _ui;
-
+        private Dictionary<string, int> _data = new Dictionary<string, int>();
         public override void Dispose()
         public override void Dispose()
         {
         {
 
 
@@ -20,7 +21,7 @@ namespace GFGGame
             _ui = UI_SuitPropertyShowUI.Create();
             _ui = UI_SuitPropertyShowUI.Create();
             this.viewCom = _ui.target;
             this.viewCom = _ui.target;
             this.viewCom.Center();
             this.viewCom.Center();
-            // this.modal = true;
+            this.modal = true;
             // viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
             // viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
 
 
         }
         }
@@ -28,7 +29,17 @@ namespace GFGGame
         protected override void OnShown()
         protected override void OnShown()
         {
         {
             base.OnShown();
             base.OnShown();
-
+            int suitId = (int)(this.viewData as object[])[0];
+            int index = (int)(this.viewData as object[])[1];
+            SuitFosterCfg cfg = SuitFosterCfgArray.Instance.GetCfgs(suitId)[index];
+            for (int i = 0; i < cfg.partsArr.Length; i++)
+            {
+                ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cfg.partsArr[i][0]);
+                string type = ItemTypeCfgArray.Instance.GetCfg(itemCfg.subType).name;
+                // if(!_data.ContainsKey(type))
+                // int 
+                // _data.Add()
+            }
         }
         }
 
 
         protected override void OnHide()
         protected override void OnHide()

+ 18 - 2
GameClient/Assets/Game/HotUpdate/Views/ClothingFoster/SuitView.cs

@@ -9,13 +9,16 @@ namespace GFGGame
     {
     {
         private UI_SuitUI _ui;
         private UI_SuitUI _ui;
 
 
-        private int _suitId;
         private GameObject _scenePrefab;
         private GameObject _scenePrefab;
         private GameObject _sceneObject;
         private GameObject _sceneObject;
         private GoWrapper _wrapper;
         private GoWrapper _wrapper;
         private DressUpObjDataCache _dressUpObjDataCache;
         private DressUpObjDataCache _dressUpObjDataCache;
         private bool _actionIsPic;
         private bool _actionIsPic;
         private List<int> _suitIds;
         private List<int> _suitIds;
+
+        private int _suitId;
+        private int _index;
+
         public override void Dispose()
         public override void Dispose()
         {
         {
 
 
@@ -41,6 +44,7 @@ namespace GFGGame
             _ui.m_btnLeft.onClick.Add(() => { OnClickBtnDirection(-1); });
             _ui.m_btnLeft.onClick.Add(() => { OnClickBtnDirection(-1); });
             _ui.m_btnRight.onClick.Add(() => { OnClickBtnDirection(1); });
             _ui.m_btnRight.onClick.Add(() => { OnClickBtnDirection(1); });
             _ui.m_btnReward.target.onClick.Add(OnClickBtnReward);
             _ui.m_btnReward.target.onClick.Add(OnClickBtnReward);
+            _ui.m_btnPropertyShow.onClick.Add(OnClickBtnPropertyShow);
 
 
             _ui.m_listFoster.itemRenderer = ListFosterItemRender;
             _ui.m_listFoster.itemRenderer = ListFosterItemRender;
             _ui.m_listFoster.onClickItem.Add(OnClickListFosterItem);
             _ui.m_listFoster.onClickItem.Add(OnClickListFosterItem);
@@ -133,14 +137,26 @@ namespace GFGGame
         {
         {
             UI_ListFosterItem item = UI_ListFosterItem.Proxy(obj);
             UI_ListFosterItem item = UI_ListFosterItem.Proxy(obj);
             item.target.data = index;
             item.target.data = index;
+            if (index == 0)
+            {
+                _index = index;
+            }
         }
         }
         private void OnClickListFosterItem(EventContext context)
         private void OnClickListFosterItem(EventContext context)
         {
         {
-            ViewManager.Show<SuitFosterView>(new object[] { _suitId, (int)((context.data as GObject).data) });
+            int index = (int)(context.data as GObject).data;
+            if (index == _index)
+            {
+                ViewManager.Show<SuitFosterView>(new object[] { _suitId, index });
+            }
         }
         }
         private void OnClickBtnReward()
         private void OnClickBtnReward()
         {
         {
             ViewManager.Show<SuitRewardView>(_suitId);
             ViewManager.Show<SuitRewardView>(_suitId);
         }
         }
+        private void OnClickBtnPropertyShow()
+        {
+            ViewManager.Show<SuitPropertyShowView>(new object[] { _suitId, _index });
+        }
     }
     }
 }
 }