浏览代码

战斗选卡特效

zhaoyang 3 年之前
父节点
当前提交
cec6b83b51

+ 3 - 2
FGUIProject/assets/Main/components/ListCardItem.xml

@@ -8,9 +8,10 @@
     <component id="n11_wzce" name="comStar" src="ojlzh" fileName="components/ComStar.xml" pkg="eg2y0ldp" xy="10,196"/>
     <text id="n12_wzce" name="txtLv" xy="169,170" pivot="0.5,0" size="39,56" fontSize="24" color="#fff9f1" leading="-8" ubb="true" vars="true" text="Lv.&#xA;30"/>
     <loader id="n7_sx2v" name="loaRarity" xy="160,6" size="50,50" url="ui://eg2y0ldppq5x62" autoSize="true"/>
-    <image id="n10_wzce" name="n10" src="sx2v9t" fileName="imagesStory/zd_tctcdikugn_2.png" xy="-1,0">
+    <image id="n15_dcro" name="n15" src="sx2v9t" fileName="imagesStory/zd_tctcdikugn_2.png" xy="-1,0"/>
+    <graph id="n13_dcro" name="holder" xy="107,114" size="1,1" touchable="false" type="rect">
       <gearDisplay controller="button" pages="1"/>
-    </image>
+    </graph>
   </displayList>
   <Button mode="Radio"/>
 </component>

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Main/UI_ListCardItem.cs

@@ -12,6 +12,7 @@ namespace UI.Main
         public GComponent m_comStar;
         public GTextField m_txtLv;
         public GLoader m_loaRarity;
+        public GGraph m_holder;
         public const string URL = "ui://mfvz4q8kr1a99f";
         public const string PACKAGE_NAME = "Main";
         public const string RES_NAME = "ListCardItem";
@@ -64,6 +65,7 @@ namespace UI.Main
             m_comStar = (GComponent)comp.GetChild("comStar");
             m_txtLv = (GTextField)comp.GetChild("txtLv");
             m_loaRarity = (GLoader)comp.GetChild("loaRarity");
+            m_holder = (GGraph)comp.GetChild("holder");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -73,6 +75,7 @@ namespace UI.Main
             m_comStar = null;
             m_txtLv = null;
             m_loaRarity = null;
+            m_holder = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 26 - 7
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryCardChoose.cs

@@ -13,9 +13,15 @@ namespace GFGGame
         private List<CardData> cardList = new List<CardData>();
         private static int _scoreType;
 
+        private List<GameObject> _effects = new List<GameObject>();
+        private List<GoWrapper> _wrappers = new List<GoWrapper>();
         public override void Dispose()
         {
             base.Dispose();
+            for (int i = 0; i < _effects.Count; i++)
+            {
+                SceneController.DestroyObjectFromView(_effects[i]);
+            }
         }
 
         protected override void OnInit()
@@ -66,14 +72,27 @@ namespace GFGGame
         private void RenderListCardItem(int index, GObject obj)
         {
             CardData cardData = cardList[index];
-            GButton item = obj as GButton;
-            item.GetChild("txtName").asTextField.text = cardData.itemCfg.name;
-            item.GetChild("comCardMask").asCom.GetChild("loaCard").asLoader.url = ResPathUtil.GetCardSmallPath(cardData.resources[cardData.resIndex]);
-            item.GetChild("txtLv").asTextField.text = string.Format("Lv.\n{0}", cardData.lv);
-            item.GetChild("loaRarity").asLoader.url = ResPathUtil.GetCommonGameResPath("kp_sxing_x_" + cardData.itemCfg.rarity);
-            UI_ComStar comStar = UI_ComStar.Proxy(item.GetChild("comStar").asCom);
+            UI_ListCardItem item = UI_ListCardItem.Proxy(obj);// obj as GButton;
+            // item.GetChild("txtName").asTextField.text = cardData.itemCfg.name;
+            // item.GetChild("comCardMask").asCom.GetChild("loaCard").asLoader.url = ResPathUtil.GetCardSmallPath(cardData.resources[cardData.resIndex]);
+            // item.GetChild("txtLv").asTextField.text = string.Format("Lv.\n{0}", cardData.lv);
+            // item.GetChild("loaRarity").asLoader.url = ResPathUtil.GetCommonGameResPath("kp_sxing_x_" + cardData.itemCfg.rarity);
+            // UI_ComStar comStar = UI_ComStar.Proxy(item.GetChild("comStar").asCom);
+            // comStar.m_c1.selectedIndex = cardData.star;
+            item.m_txtName.text = cardData.itemCfg.name;
+            item.m_comCardMask.m_loaCard.asLoader.url = ResPathUtil.GetCardSmallPath(cardData.resources[cardData.resIndex]);
+            item.m_txtLv.text = string.Format("Lv.\n{0}", cardData.lv);
+            item.m_loaRarity.url = ResPathUtil.GetCommonGameResPath("kp_sxing_x_" + cardData.itemCfg.rarity);
+            UI_ComStar comStar = UI_ComStar.Proxy(item.m_comStar);
             comStar.m_c1.selectedIndex = cardData.star;
-
+            if (_effects.Count <= index)
+            {
+                string resPath = ResPathUtil.GetViewEffectPath("ui_xz", "ui_xz_zd_kq");
+                GameObject gameObject0;
+                GoWrapper wrapper0;
+                SceneController.AddObjectToView(null, null, item.m_holder, resPath, out gameObject0, out wrapper0);
+                _effects.Add(gameObject0);
+            }
         }
         private void OnListCardItemClick(EventContext context)
         {

二进制
GameClient/Assets/ResIn/UI/Main/Main_fui.bytes