Quellcode durchsuchen

词牌增加词牌天衣和典藏特效

huangxiaoyue vor 1 Jahr
Ursprung
Commit
fa662f116f

+ 71 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Card/UI_CardDetailList.cs

@@ -0,0 +1,71 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.Card
+{
+    public partial class UI_CardDetailList
+    {
+        public GComponent target;
+        public GList m_listCard;
+        public const string URL = "ui://7l6lvkaysl2ntr0";
+        public const string PACKAGE_NAME = "Card";
+        public const string RES_NAME = "CardDetailList";
+        private static UI_CardDetailList _proxy;
+
+        public static UI_CardDetailList Create(GObject gObject = null)
+        {
+            var ui = new UI_CardDetailList();
+            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_CardDetailList Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_CardDetailList();
+            }
+            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_listCard = (GList)comp.GetChild("listCard");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_listCard = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Card/UI_CardDetailList.cs.meta

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

+ 4 - 3
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Card/UI_CardDetailUI.cs

@@ -11,7 +11,7 @@ namespace UI.Card
         public GButton m_btnBack;
         public GButton m_btnFilter;
         public GList m_listRole;
-        public GList m_listCard;
+        public UI_CardDetailList m_comListCard;
         public GTextField m_txtTips;
         public Transition m_In;
         public Transition m_Refresh;
@@ -66,7 +66,7 @@ namespace UI.Card
             m_btnBack = (GButton)comp.GetChild("btnBack");
             m_btnFilter = (GButton)comp.GetChild("btnFilter");
             m_listRole = (GList)comp.GetChild("listRole");
-            m_listCard = (GList)comp.GetChild("listCard");
+            m_comListCard = (UI_CardDetailList)UI_CardDetailList.Create(comp.GetChild("comListCard"));
             m_txtTips = (GTextField)comp.GetChild("txtTips");
             m_In = comp.GetTransition("In");
             m_Refresh = comp.GetTransition("Refresh");
@@ -77,7 +77,8 @@ namespace UI.Card
             m_btnBack = null;
             m_btnFilter = null;
             m_listRole = null;
-            m_listCard = null;
+            m_comListCard.Dispose();
+            m_comListCard = null;
             m_txtTips = null;
             m_In = null;
             m_Refresh = null;

+ 6 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CommonGame/UI_ListCardItem.cs

@@ -12,6 +12,8 @@ namespace UI.CommonGame
         public UI_ComCardMask m_comCard;
         public GLoader m_loaBorder;
         public GLoader m_loaRarity;
+        public GGraph m_holderGoldBg;
+        public GGraph m_holderPurpleBg;
         public GTextField m_txtLv;
         public GTextField m_txtName;
         public GLoader m_loaMainScore;
@@ -72,6 +74,8 @@ namespace UI.CommonGame
             m_comCard = (UI_ComCardMask)UI_ComCardMask.Create(comp.GetChild("comCard"));
             m_loaBorder = (GLoader)comp.GetChild("loaBorder");
             m_loaRarity = (GLoader)comp.GetChild("loaRarity");
+            m_holderGoldBg = (GGraph)comp.GetChild("holderGoldBg");
+            m_holderPurpleBg = (GGraph)comp.GetChild("holderPurpleBg");
             m_txtLv = (GTextField)comp.GetChild("txtLv");
             m_txtName = (GTextField)comp.GetChild("txtName");
             m_loaMainScore = (GLoader)comp.GetChild("loaMainScore");
@@ -89,6 +93,8 @@ namespace UI.CommonGame
             m_comCard = null;
             m_loaBorder = null;
             m_loaRarity = null;
+            m_holderGoldBg = null;
+            m_holderPurpleBg = null;
             m_txtLv = null;
             m_txtName = null;
             m_loaMainScore = null;

+ 45 - 13
GameClient/Assets/Game/HotUpdate/Views/Card/CardDetailView.cs

@@ -12,6 +12,7 @@ namespace GFGGame
         private UI_CardDetailUI _ui;
         private const int listRoleCount = 5;
         private bool _startInAnim;
+        private Dictionary<string, EffectUI> _effectUIDic = new Dictionary<string, EffectUI>();
 
         public override void Dispose()
         {
@@ -36,9 +37,9 @@ namespace GFGGame
             // _ui.m_btnHome.onClick.Add(OnClickBtnHome);
             _ui.m_btnFilter.onClick.Add(OnclickBtnFilter);
 
-            _ui.m_listCard.itemRenderer = RenderListCardItem;
-            _ui.m_listCard.onClickItem.Add(OnClickListCardItem);
-            _ui.m_listCard.SetVirtual();
+            _ui.m_comListCard.m_listCard.itemRenderer = RenderListCardItem;
+            _ui.m_comListCard.m_listCard.onClickItem.Add(OnClickListCardItem);
+            _ui.m_comListCard.m_listCard.SetVirtual();
 
             _ui.m_listRole.itemRenderer = RenderListRoleItem;
             _ui.m_listRole.onClickItem.Add(OnClickListRoleItem);
@@ -75,13 +76,19 @@ namespace GFGGame
             if (_startInAnim)
             {
                 _startInAnim = false;
-                _ui.m_listCard.scrollPane.ScrollTop();
+                _ui.m_comListCard.m_listCard.scrollPane.ScrollTop();
                 _ui.m_In.Play();
             }
         }
         protected override void OnHide()
         {
             base.OnHide();
+            foreach (var v in _effectUIDic)
+            {
+                EffectUIPool.Recycle(v.Value);
+            }
+            _effectUIDic.Clear();
+
             this.Clear();
             Timers.inst.Remove(CheckGuide);
         }
@@ -99,7 +106,7 @@ namespace GFGGame
         private void FilterItems()
         {
             _ui.m_Refresh.Play();
-            _ui.m_listCard.scrollPane.ScrollTop();
+            _ui.m_comListCard.m_listCard.scrollPane.ScrollTop();
             UpdateCardList();
         }
 
@@ -112,16 +119,21 @@ namespace GFGGame
                 cardList = CardDataManager.FilterCardList(cardList);
             }
             cardList = CardDataManager.SortItemList(cardList);
-            _ui.m_listCard.data = cardList;
-            _ui.m_listCard.numItems = cardList.Count;
+            foreach (var v in _effectUIDic)
+            {
+                EffectUIPool.Recycle(v.Value);
+            }
+            _effectUIDic.Clear();
+            _ui.m_comListCard.m_listCard.data = cardList;
+            _ui.m_comListCard.m_listCard.numItems = cardList.Count;
 
-            _ui.m_txtTips.visible = _ui.m_listCard.numItems == 0 ? true : false;
+            _ui.m_txtTips.visible = _ui.m_comListCard.m_listCard.numItems == 0 ? true : false;
         }
 
         private void RenderListCardItem(int index, GObject obj)
         {
             UI_ListCardItem listItem = UI_ListCardItem.Proxy(obj);
-            CardData data = (_ui.m_listCard.data as List<CardData>)[index];//CardDataManager.GetCardList(_ui.m_listRole.selectedIndex)[index];
+            CardData data = (_ui.m_comListCard.m_listCard.data as List<CardData>)[index];//CardDataManager.GetCardList(_ui.m_listRole.selectedIndex)[index];
             data.index = index;
             data.pageIndex = _ui.m_listRole.selectedIndex;
             listItem.target.data = data;
@@ -134,6 +146,26 @@ namespace GFGGame
             listItem.m_txtName.text = data.itemCfg.name;
             RedDotController.Instance.SetComRedDot(listItem.target, RedDotDataManager.Instance.GetCardRed(data.id), "", 5, -10);
 
+            if (data.itemCfg.rarity == 4)
+            {
+                listItem.m_holderGoldBg.visible = true;
+                listItem.m_holderPurpleBg.visible = false;
+                if (!_effectUIDic.ContainsKey("gold" + obj.id))
+                    _effectUIDic.Add("gold" + obj.id, EffectUIPool.CreateEffectUI(listItem.m_holderGoldBg, "ui_KP", "KP_Gold_Frame"));
+            }
+            else if (data.itemCfg.rarity == 3)
+            {
+                listItem.m_holderPurpleBg.visible = true;
+                listItem.m_holderGoldBg.visible = false;
+                if (!_effectUIDic.ContainsKey("purple" + obj.id))
+                    _effectUIDic.Add("purple" + obj.id, EffectUIPool.CreateEffectUI(listItem.m_holderPurpleBg, "ui_KP", "KP_Purple_Frame"));
+            }
+            else
+            {
+                listItem.m_holderGoldBg.visible = false;
+                listItem.m_holderPurpleBg.visible = false;
+            }
+
             int starLevelDodge = data.star / 5;
             listItem.m_starNumType.selectedIndex = data.itemCfg.starDescArr.Length - 1;
             for (int i = 0; i < data.itemCfg.starDescArr.Length; i++)
@@ -167,7 +199,7 @@ namespace GFGGame
 
             this.UpdateCardList();
 
-            _ui.m_listCard.scrollPane.ScrollTop();
+            _ui.m_comListCard.m_listCard.scrollPane.ScrollTop();
             _ui.m_Refresh.Play();
 
             UI_Button21 button = UI_Button21.Proxy(gObject);
@@ -195,7 +227,7 @@ namespace GFGGame
             // this._selectType = 0;
             CardDataManager._selectList.Clear();
             _ui.m_listRole.selectedIndex = 0;
-            _ui.m_listCard.selectedIndex = 0;
+            _ui.m_comListCard.m_listCard.selectedIndex = 0;
         }
 
         private void CheckGuide(object param)
@@ -215,9 +247,9 @@ namespace GFGGame
         {
             if (!ViewManager.CheckIsTopView(this.viewCom)) return;
 
-            GuideController.TryGuide(_ui.m_listCard, ConstGuideId.UP_CARD_LV, 3, "选择可升级的词牌。", 0);
+            GuideController.TryGuide(_ui.m_comListCard.m_listCard, ConstGuideId.UP_CARD_LV, 3, "选择可升级的词牌。", 0);
             GuideController.TryGuide(_ui.m_btnBack, ConstGuideId.ENTER_CHAPTER_1, 1, "");
-            GuideController.TryGuide(_ui.m_listCard, ConstGuideId.UP_CARD_STAR, 3, "选择可升星的词牌。", 0);
+            GuideController.TryGuide(_ui.m_comListCard.m_listCard, ConstGuideId.UP_CARD_STAR, 3, "选择可升星的词牌。", 0);
 
             GuideController.TryGuide(_ui.m_btnBack, ConstGuideId.UP_CARD_STAR, 8, "");
             GuideController.TryCompleteGuide(ConstGuideId.UP_CARD_STAR, 8);

BIN
GameClient/Assets/ResIn/UI/Card/Card_fui.bytes


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