Explorar o código

转盘补充抽奖

zhangyuqian hai 11 meses
pai
achega
ed0004f0dd

+ 71 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/TurnTable/UI_ComRewardList.cs

@@ -0,0 +1,71 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.TurnTable
+{
+    public partial class UI_ComRewardList
+    {
+        public GComponent target;
+        public GList m_listReward;
+        public const string URL = "ui://zioq0m8xuufi1o";
+        public const string PACKAGE_NAME = "TurnTable";
+        public const string RES_NAME = "ComRewardList";
+        private static UI_ComRewardList _proxy;
+
+        public static UI_ComRewardList Create(GObject gObject = null)
+        {
+            var ui = new UI_ComRewardList();
+            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_ComRewardList Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_ComRewardList();
+            }
+            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/TurnTable/UI_ComRewardList.cs.meta

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

+ 96 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/TurnTable/UI_TurnTableRewardUI.cs

@@ -0,0 +1,96 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.TurnTable
+{
+    public partial class UI_TurnTableRewardUI
+    {
+        public GComponent target;
+        public GGraph m_mask;
+        public GGraph m_bgEffect;
+        public GGraph m_bgEffect1;
+        public GGraph m_holderBgCom;
+        public GGraph m_holderTitle;
+        public GGroup m_downTipsText;
+        public UI_ComRewardList m_comList;
+        public GGroup m_grp;
+        public Transition m_openViewAction;
+        public const string URL = "ui://zioq0m8xuufi1n";
+        public const string PACKAGE_NAME = "TurnTable";
+        public const string RES_NAME = "TurnTableRewardUI";
+        private static UI_TurnTableRewardUI _proxy;
+
+        public static UI_TurnTableRewardUI Create(GObject gObject = null)
+        {
+            var ui = new UI_TurnTableRewardUI();
+            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_TurnTableRewardUI Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_TurnTableRewardUI();
+            }
+            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_mask = (GGraph)comp.GetChild("mask");
+            m_bgEffect = (GGraph)comp.GetChild("bgEffect");
+            m_bgEffect1 = (GGraph)comp.GetChild("bgEffect1");
+            m_holderBgCom = (GGraph)comp.GetChild("holderBgCom");
+            m_holderTitle = (GGraph)comp.GetChild("holderTitle");
+            m_downTipsText = (GGroup)comp.GetChild("downTipsText");
+            m_comList = (UI_ComRewardList)UI_ComRewardList.Create(comp.GetChild("comList"));
+            m_grp = (GGroup)comp.GetChild("grp");
+            m_openViewAction = comp.GetTransition("openViewAction");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_mask = null;
+            m_bgEffect = null;
+            m_bgEffect1 = null;
+            m_holderBgCom = null;
+            m_holderTitle = null;
+            m_downTipsText = null;
+            m_comList.Dispose();
+            m_comList = null;
+            m_grp = null;
+            m_openViewAction = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/TurnTable/UI_TurnTableRewardUI.cs.meta

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

+ 243 - 0
GameClient/Assets/Game/HotUpdate/Views/TurnTable/TurnTableRewardTIpsView.cs

@@ -0,0 +1,243 @@
+using System.Collections;
+using UnityEngine;
+using UI.TurnTable;
+using FairyGUI;
+using System.Collections.Generic;
+using System;
+
+namespace GFGGame
+{
+    public class TurnTableTipsRewardView : BaseWindow
+    {
+        private UI_TurnTableRewardUI _ui;
+        private List<ItemData> _listItemDatas;
+
+        private Action onSuccess = null;
+
+        private List<EffectUI> _effects = new List<EffectUI>();
+
+        private const int maxHeight = 1030;
+
+        private EffectUI _effectUI1;
+        private EffectUI _effectUI2;
+        private EffectUI _effectUI3;
+        private EffectUI _effectUI4;
+        private int counTime = 0;  //定时器计数
+
+        public override void Dispose()
+        {
+            if (_ui != null)
+            {
+                _ui.Dispose();
+                _ui = null;
+            }
+            base.Dispose();
+
+        }
+
+        protected override void OnInit()
+        {
+            base.OnInit();
+            packageName = UI_TurnTableRewardUI.PACKAGE_NAME;
+            _ui = UI_TurnTableRewardUI.Create();
+            this.viewCom = _ui.target;
+            //this.viewCom.Center();
+            //this.modal = true;
+            //viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
+            isfullScreen = true;
+
+            _ui.m_comList.m_listReward.itemRenderer = RenderListRewardItem;
+            _ui.m_mask.onClick.Add(this.Hide);
+
+            _effectUI3 = EffectUIPool.CreateEffectUI(_ui.m_bgEffect, "ui_league", "TEA");
+            _effectUI4 = EffectUIPool.CreateEffectUI(_ui.m_bgEffect1, "ui_LuckyBox", "CK_Yellow_01");
+        }
+        protected override void OnShown()
+        {
+            base.OnShown();
+            _ui.m_mask.touchable = false;
+            if ((this.viewData as object[]).Length > 0)
+            {
+                _listItemDatas = (this.viewData as object[])[0] as List<ItemData>;
+                onSuccess = (this.viewData as object[])[1] as Action;
+            }
+            else
+            {
+                _listItemDatas = this.viewData as List<ItemData>;
+            }
+
+            List<ItemData> suitPart = new List<ItemData>(); ;
+            for (int i = _listItemDatas.Count - 1; i >= 0; i--)
+            {
+                SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(_listItemDatas[i].id);
+                if (suitCfg != null)
+                {
+                    for (int j = 0; j < suitCfg.partsArr.Length; j++)
+                    {
+                        suitPart.Add(ItemUtil.createItemData(suitCfg.partsArr[j], _listItemDatas[i].num));
+                    }
+                    _listItemDatas.RemoveAt(i);
+                }
+            }
+            _listItemDatas.AddRange(suitPart);
+            //_ui.m_listReward.SetVirtual();  //有虚拟列表的时候,没有办法居中显示列表
+
+            _ui.m_downTipsText.visible = false;
+            _ui.m_comList.m_listReward.numItems = 0;
+            counTime = 0;
+            Timers.inst.Add(0.1f, 3, OnTimerUpdate, 1);
+            Timers.inst.Add(0.5f, 1, OnTimerClick);
+        }
+
+        private void OnTimerClick(object param)
+        {
+            _ui.m_mask.touchable = true;
+        }
+
+        private void OnTimerUpdate(object param)
+        {
+            counTime += 1;
+            if (counTime == 1)
+            {
+                _effectUI1 = EffectUIPool.CreateEffectUI(_ui.m_holderTitle, "ui_hd", "GXHD_Text");
+                _effectUI2 = EffectUIPool.CreateEffectUI(_ui.m_holderBgCom, "ui_hd", "TC_Quad_ALL");
+            }
+            else if (counTime == 2)
+            {
+                _ui.m_comList.m_listReward.numItems = _listItemDatas.Count;
+
+                _ui.m_comList.m_listReward.ResizeToFit();
+                if (_ui.m_comList.m_listReward.height > maxHeight)
+                {
+                    _ui.m_comList.m_listReward.height = maxHeight;
+                }
+            }
+            else if (counTime == 3)
+            {
+                _ui.m_downTipsText.visible = true;
+                Timers.inst.Remove(OnTimerUpdate);
+            }
+        }
+
+        protected override void OnHide()
+        {
+            EffectUIPool.Recycle(_effectUI1);
+            _effectUI1 = null;
+            EffectUIPool.Recycle(_effectUI2);
+            _effectUI2 = null;
+            EffectUIPool.Recycle(_effectUI3);
+            _effectUI3 = null;
+            EffectUIPool.Recycle(_effectUI4);
+            _effectUI4 = null;
+            Timers.inst.Remove(OnTimerUpdate);
+            Timers.inst.Remove(OnTimerClick);
+            _ui.m_mask.touchable = true;
+            for (int i = 0; i < _effects.Count; i++)
+            {
+                if (_effects[i] != null)
+                {
+                    EffectUIPool.Recycle(_effects[i]);
+                    _effects[i] = null;
+                }
+            }
+            _effects.Clear();
+
+            if (onSuccess != null)
+            {
+                onSuccess();
+            }
+            base.OnHide();
+            //_effects.Clear();
+            //EventAgent.DispatchEvent(ConstMessage.REWARDVIEW_CLOTHER);
+            GetSuitItemController.TryShow(0);
+            if (ActivityDataManager.Instance.StartDropId != ActivityDataManager.Instance.TipsDropId)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("特殊奖励已改变!");
+                ActivityDataManager.Instance.StartDropId = ActivityDataManager.Instance.TipsDropId;
+            }
+        }
+        private void RenderListRewardItem(int index, GObject obj)
+        {
+            // obj.data = _listItemDatas[index];
+            UI.CommonGame.UI_ComItem item = UI.CommonGame.UI_ComItem.Proxy(obj);
+            string name = "";
+            string iconRes = "";
+            string ext = "png";
+            int rarity = 0;
+            int id = 0;
+            bool isSuit = false;
+
+            SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(_listItemDatas[index].id);
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_listItemDatas[index].id);
+
+            if (suitCfg != null)
+            {
+                name = suitCfg.name;
+                iconRes = suitCfg.res;
+                rarity = suitCfg.rarity;
+                id = suitCfg.id;
+                isSuit = true;
+            }
+            else
+            {
+                name = itemCfg.name;
+                ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true);
+                iconRes = itemCfg.res;
+                id = itemCfg.id;
+                isSuit = false;
+                //if (itemCfg.itemType == ConstItemType.DRESS_UP)
+                rarity = itemCfg.rarity;
+            }
+
+            item.m_txtName.text = name;
+            // item.m_txtCount.text = _listItemDatas[index].num==1?"": string.Format("{0}", _listItemDatas[index].num);
+            item.m_txtCount.text = string.Format("{0}", _listItemDatas[index].num);
+            item.m_loaIcon.url = ResPathUtil.GetIconPath(iconRes, ext);
+            if (rarity > 0)
+            {
+                item.m_QualityType.selectedIndex = rarity - 1;
+            }
+            else
+            {
+                item.m_QualityType.selectedIndex = 0;
+            }
+
+            RarityIconController.UpdateRarityIcon(item.m_loaRarity, id, false, isSuit);
+
+            item.m_imgOnceBonus.visible = _listItemDatas[index].isOnceBonus;
+            //特效("ui_ck", "ui_ck_zl");
+            int childIndex = _ui.m_comList.m_listReward.ItemIndexToChildIndex(index);
+            if (_effects.Count <= childIndex)
+            {
+                EffectUI _effectUI = EffectUIPool.CreateEffectUI(item.m_holderReware, "ui_hd", "GXHD_WuPin", 120);
+                _effects.Add(_effectUI);
+            }
+
+            if (item.target.data == null)
+            {
+                item.target.onClick.Add(OnClickListReward);
+            }
+            item.target.data = _listItemDatas[index];
+            UI.CommonGame.UI_ComItem.ProxyEnd();
+        }
+
+        private void OnClickListReward(EventContext context)
+        {
+            if (this.ShowTips)
+            {
+                ItemData data = (context.sender as GObject).data as ItemData;
+                GoodsItemTipsController.ShowItemTips(data.id);
+            }
+        }
+
+        private bool _showTips = true;
+        /// <summary>
+        /// 是否展示物品详情,默认展示
+        /// </summary>
+        private bool ShowTips
+        {
+            get { return _showTips; }
+            set { _showTips = value; }
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Views/TurnTable/TurnTableRewardTIpsView.cs.meta

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

+ 3 - 6
GameClient/Assets/Game/HotUpdate/Views/TurnTable/TurnTableView.cs

@@ -52,11 +52,9 @@ namespace GFGGame
             EffectUIPool.Recycle(_effectUI4);
             _effectUI4 = null;
             EffectUIPool.Recycle(_effectUI5);
-            _effectUI4 = null;
+            _effectUI5 = null;
             EffectUIPool.Recycle(_effectUI6);
-            _effectUI4 = null;
-            EffectUIPool.Recycle(_effectUI7);
-            _effectUI4 = null;
+            _effectUI6 = null;
             EffectUIPool.Recycle(_effectUISpecial);
             _effectUISpecial = null;
             foreach (var v in _effectUIDic)
@@ -112,7 +110,6 @@ namespace GFGGame
             _effectUI4 = EffectUIPool.CreateEffectUI(_ui.m_btnEffectThree, "ui_Activity", "HHYY_Button/HHYY_Button");
             _effectUI5 = EffectUIPool.CreateEffectUI(_ui.m_bgEffec1, "ui_Activity", "HHYY_BG_TX/HHYY_BG_TX");
             _effectUI6 = EffectUIPool.CreateEffectUI(_ui.m_bgEffec2, "ui_Activity", "HHYY_BG_TX/HHYY_BG_TX");
-            _effectUI7 = EffectUIPool.CreateEffectUI(_ui.m_bgEffec3, "ui_Activity", "HHYY_BG_TX/HHYY_BG_TX");
             _effectUISpecial = EffectUIPool.CreateEffectUI(_ui.m_specialEffect, "ui_Activity", "HHYY_Select_Special/HHYY_Select_Special");
         }
         protected override void OnShown()
@@ -168,7 +165,7 @@ namespace GFGGame
         {
             if (ActivityDataManager.Instance.TurnSpecialRewardList != null && ActivityDataManager.Instance.TurnSpecialRewardList.Count > 0)
             {
-                ViewManager.Show<MatchingCompetitionRewardView>(new object[] { ItemUtil.CreateItemDataList(ActivityDataManager.Instance.TurnSpecialRewardList), null });
+                ViewManager.Show<TurnTableTipsRewardView>(new object[] { ItemUtil.CreateItemDataList(ActivityDataManager.Instance.TurnSpecialRewardList), null });
                 ActivityDataManager.Instance.TurnSpecialRewardList = null;
             }
         }

BIN=BIN
GameClient/Assets/ResIn/UI/TurnTable/TurnTable_fui.bytes