Browse Source

通用奖励预览

zhaoyang 3 years ago
parent
commit
e09dc53bc6

+ 1 - 1
FGUIProject/assets/DailyTask/DailyTaskRewardUI.xml → FGUIProject/assets/CommonGame/RewardPreviewUI.xml

@@ -2,7 +2,7 @@
 <component size="936,631">
   <displayList>
     <image id="n1_kzte" name="bg" src="lwri5u" fileName="imagesExport/hc_kuang_6.png" pkg="mk0fwx0x" xy="0,0" size="936,631"/>
-    <image id="n2_kzte" name="n2" src="kztethr" fileName="imagesExport/hyhy_btbt_1.png" pkg="eg2y0ldp" xy="230,32"/>
+    <image id="n2_kzte" name="n2" src="kztethr" fileName="imagesExport/hyhy_btbt_1.png" xy="230,32"/>
     <text id="n3_kzte" name="txtName" xy="326,32" pivot="0.5,0" size="284,74" fontSize="56" color="#8f6e30" text="活跃度奖励"/>
     <list id="n4_kzte" name="list" xy="17,212" size="902,199" layout="row" overflow="scroll" scroll="horizontal" colGap="5" defaultItem="ui://eg2y0ldpj48o98" align="center">
       <item/>

+ 1 - 0
FGUIProject/assets/CommonGame/package.xml

@@ -192,6 +192,7 @@
     <image id="gd29ti0" name="jingzhongh_bg.jpg" path="/bgimg/"/>
     <font id="rkrwti1" name="SHUANGYUJUTI.TTF" path="/" exported="true" renderMode="" samplePointSize="16"/>
     <image id="q08xs" name="hz_xzkuang.png" path="/imagesExport/" exported="true"/>
+    <component id="lh8v7" name="RewardPreviewUI.xml" path="/" exported="true"/>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\CommonGame" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>

+ 0 - 1
FGUIProject/assets/DailyTask/package.xml

@@ -6,7 +6,6 @@
     <component id="lh8v4" name="Button2.xml" path="/components/"/>
     <component id="lh8v5" name="ListItem.xml" path="/components/"/>
     <component id="lh8v6" name="ListBoxRewardItem.xml" path="/components/"/>
-    <component id="lh8v7" name="DailyTaskRewardUI.xml" path="/" exported="true"/>
     <image id="wet228" name="mrqd_ylq.png" path="/images/"/>
     <image id="wet229" name="mrqd_1.png" path="/images/"/>
     <image id="wet22a" name="mrqd_2.png" path="/images/"/>

+ 10 - 10
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/DailyTask/UI_DailyTaskRewardUI.cs → GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CommonGame/UI_RewardPreviewUI.cs

@@ -2,23 +2,23 @@
 
 using FairyGUI;
 
-namespace UI.DailyTask
+namespace UI.CommonGame
 {
-    public partial class UI_DailyTaskRewardUI
+    public partial class UI_RewardPreviewUI
     {
         public GComponent target;
         public GImage m_bg;
         public GTextField m_txtName;
         public GList m_list;
         public GTextField m_txtDesc;
-        public const string URL = "ui://5mpsibzzlh8v7";
-        public const string PACKAGE_NAME = "DailyTask";
-        public const string RES_NAME = "DailyTaskRewardUI";
-        private static UI_DailyTaskRewardUI _proxy;
+        public const string URL = "ui://eg2y0ldplh8v7";
+        public const string PACKAGE_NAME = "CommonGame";
+        public const string RES_NAME = "RewardPreviewUI";
+        private static UI_RewardPreviewUI _proxy;
 
-        public static UI_DailyTaskRewardUI Create(GObject gObject = null)
+        public static UI_RewardPreviewUI Create(GObject gObject = null)
         {
-            var ui = new UI_DailyTaskRewardUI();
+            var ui = new UI_RewardPreviewUI();
             if(gObject == null)
             	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
             else
@@ -27,11 +27,11 @@ namespace UI.DailyTask
             return ui;
         }
 
-        public static UI_DailyTaskRewardUI Proxy(GObject gObject = null)
+        public static UI_RewardPreviewUI Proxy(GObject gObject = null)
         {
             if(_proxy == null)
             {
-                _proxy = new UI_DailyTaskRewardUI();
+                _proxy = new UI_RewardPreviewUI();
             }
             var ui = _proxy;
             if(gObject == null)

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/DailyTask/DailyTaskRewardView.cs.meta → GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CommonGame/UI_RewardPreviewUI.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: b8882e32797c1cb4aa237527a307c6e6
+guid: db2930cefe024b64bb0f0840832fc66b
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 10 - 9
GameClient/Assets/Game/HotUpdate/Views/DailyTask/DailyTaskRewardView.cs → GameClient/Assets/Game/HotUpdate/Views/CommonGame/RewardPreView.cs

@@ -7,11 +7,11 @@ using UnityEngine;
 
 namespace GFGGame
 {
-    public class DailyTaskRewardView : BaseWindow
+    public class RewardPreView : BaseWindow
     {
-        private UI_DailyTaskRewardUI _ui;
-        private DailyActiveRewardCfg _cfg;
+        private UI_RewardPreviewUI _ui;
 
+        private List<ItemData> _rewardDatas;
         public override void Dispose()
         {
             if (_ui != null)
@@ -25,22 +25,23 @@ namespace GFGGame
         protected override void OnInit()
         {
             base.OnInit();
-            _ui = UI_DailyTaskRewardUI.Create();
+            _ui = UI_RewardPreviewUI.Create();
             this.viewCom = _ui.target;
             this.viewCom.Center();
             this.modal = true;
             viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
 
             _ui.m_list.itemRenderer = ListItemRender;
-            // _ui.m_list.onClickItem.Add(OnClickListReward);
         }
 
         protected override void OnShown()
         {
             base.OnShown();
-            _cfg = this.viewData as DailyActiveRewardCfg;
-            _ui.m_list.numItems = _cfg.rewardsArr.Length;
-            _ui.m_txtDesc.text = string.Format("满足{0}活跃度可领取", _cfg.count);
+            // _cfg = this.viewData as DailyActiveRewardCfg;
+            _rewardDatas = (this.viewData as object[])[0] as List<ItemData>;
+            _ui.m_list.numItems = _rewardDatas.Count;
+            _ui.m_txtName.text = (this.viewData as object[])[1].ToString();
+            _ui.m_txtDesc.text = (this.viewData as object[])[2].ToString(); ;//string.Format("满足{0}活跃度可领取", _cfg.count);
         }
 
         protected override void OnHide()
@@ -50,7 +51,7 @@ namespace GFGGame
         private void ListItemRender(int index, GObject obj)
         {
             UI_ComItem item = UI_ComItem.Proxy(obj);
-            ItemData reward = ItemUtil.createItemData(_cfg.rewardsArr[index]);
+            ItemData reward = _rewardDatas[index];
             if (obj.data == null)
             {
                 obj.data = new ItemView(obj as GComponent);

+ 1 - 1
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/DailyTask/UI_DailyTaskRewardUI.cs.meta → GameClient/Assets/Game/HotUpdate/Views/CommonGame/RewardPreView.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 42381f0ab69ae1247b31595969ef407e
+guid: 127ddb541add23943836573410f11d9c
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Views/DailyTask/DailyTaskView.cs

@@ -170,7 +170,8 @@ namespace GFGGame
             }
             else
             {
-                ViewManager.Show<DailyTaskRewardView>(item.data);
+                List<ItemData> rewards = ItemUtil.CreateItemDataList(cfg.rewardsArr);
+                ViewManager.Show<RewardPreView>(new object[] { rewards, "活跃度奖励", string.Format("满足{0}活跃度可领取", cfg.count) });
             }
         }
 

BIN
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_fui.bytes


BIN
GameClient/Assets/ResIn/UI/DailyTask/DailyTask_fui.bytes