huangxiaoyue 1 rok pred
rodič
commit
d86483ca51

+ 71 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ClothingFoster/UI_ClothingRewardItemUI.cs

@@ -0,0 +1,71 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.ClothingFoster
+{
+    public partial class UI_ClothingRewardItemUI
+    {
+        public GComponent target;
+        public GList m_listReward;
+        public const string URL = "ui://uicwtr5btvuw2r";
+        public const string PACKAGE_NAME = "ClothingFoster";
+        public const string RES_NAME = "ClothingRewardItemUI";
+        private static UI_ClothingRewardItemUI _proxy;
+
+        public static UI_ClothingRewardItemUI Create(GObject gObject = null)
+        {
+            var ui = new UI_ClothingRewardItemUI();
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_ClothingRewardItemUI Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_ClothingRewardItemUI();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_listReward = (GList)comp.GetChild("listReward");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_listReward = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ClothingFoster/UI_ClothingRewardItemUI.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a75bba833417ac14fadce6bb167421bb
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 62 - 0
GameClient/Assets/Game/HotUpdate/Views/ClothingFoster/ClothingRewardItemView.cs

@@ -0,0 +1,62 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using FairyGUI;
+using UI.ClothingFoster;
+using UI.CommonGame;
+
+namespace GFGGame
+{
+    public class ClothingRewardItemView : BaseWindow
+    {
+        private UI_ClothingRewardItemUI _ui;
+        private int _suitId;
+
+        public override void Dispose()
+        {
+            if (_ui != null)
+            {
+                _ui.Dispose();
+                _ui = null;
+            }
+            base.Dispose();
+        }
+
+        protected override void OnInit()
+        {
+            base.OnInit();
+            packageName = UI_ClothingRewardItemUI.PACKAGE_NAME;
+            _ui = UI_ClothingRewardItemUI.Create();
+            this.viewCom = _ui.target;
+            this.viewCom.Center();
+            this.modal = true;
+
+            _ui.m_listReward.itemRenderer = ListRewardRender;
+        }
+
+        protected override void OnShown()
+        {
+            base.OnShown();
+            _suitId = (int)this.viewData;
+            SuitFosterListCfg cfg = SuitFosterListCfgArray.Instance.GetCfg(_suitId);
+            _ui.m_listReward.data = cfg.renewRewardsArr;
+            _ui.m_listReward.numItems = cfg.renewRewardsArr.Length;
+        }
+
+        protected override void OnHide()
+        {
+            base.OnHide();
+        }
+
+        private void ListRewardRender(int index, GObject obj)
+        {
+            int[][] rewards = (int[][])obj.parent.data;
+            ItemData itemData = ItemUtil.createItemData(rewards[index]);
+            if (obj.data == null)
+            {
+                obj.data = new ItemView(obj as GComponent);
+            }
+            (obj.data as ItemView).SetData(itemData);
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Views/ClothingFoster/ClothingRewardItemView.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 349b9e7807d4b1643820eaa1a9d55aa5
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 6 - 1
GameClient/Assets/Game/HotUpdate/Views/ClothingFoster/ClothingView.cs

@@ -61,7 +61,7 @@ namespace GFGGame
             _dressUpObjUI = new DressUpObjUI("SceneSuitFoster");
 
             _ui.m_btnBack.onClick.Add(OnClickBtnBack);
-            _ui.m_comRenewReward.target.onClick.Add(OnClickComFosterReward);
+            _ui.m_comRenewReward.target.onClick.Add(OnClickRenewRewardItem);
             _ui.m_btnLeft.onClick.Add(() => { OnClickBtnDirection(-1); });
             _ui.m_btnRight.onClick.Add(() => { OnClickBtnDirection(1); });
             _ui.m_comFosterReward.target.onClick.Add(OnClickComFosterReward);
@@ -453,5 +453,10 @@ namespace GFGGame
             GuideController.TryCompleteGuide(ConstGuideId.SUIT_LIST_VIEW, 5);
 
         }
+
+        private void OnClickRenewRewardItem()
+        {
+            ViewManager.Show<ClothingRewardItemView>(_suitId);
+        }
     }
 }