Browse Source

添加特效

zhaoyang 3 years ago
parent
commit
e0e1ffe484

+ 9 - 0
FGUIProject/assets/CommonGame/components/ComRewardItem.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="204,232">
+  <displayList>
+    <image id="n2_m9wm" name="n2" src="m9wm8s" fileName="images/gxhd_gd_dik.png" xy="0,0"/>
+    <loader id="n3_m9wm" name="loaIcon" xy="23,23" size="150,150" url="ui://eg2y0ldpm9wm8v" fill="scaleFree"/>
+    <text id="n5_m9wm" name="txtCount" xy="162,160" pivot="1,1" size="34,36" fontSize="26" color="#efd78d" text="x1"/>
+    <text id="n4_m9wm" name="txtName" xy="98,196" pivot="0.5,0" anchor="true" size="106,36" fontSize="26" color="#fdedbe" text="赵钱孙李"/>
+  </displayList>
+</component>

+ 5 - 4
FGUIProject/assets/CommonGame/components/ListRewardItem.xml

@@ -1,9 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="196,196">
   <displayList>
-    <image id="n2_m9wm" name="n2" src="m9wm8s" fileName="images/gxhd_gd_dik.png" xy="0,0"/>
-    <loader id="n3_m9wm" name="loaIcon" xy="23,23" size="150,150" url="ui://eg2y0ldpm9wm8v" fill="scaleFree"/>
-    <text id="n5_m9wm" name="txtCount" xy="162,160" pivot="1,1" size="34,36" fontSize="26" color="#efd78d" text="x1"/>
-    <text id="n4_m9wm" name="txtName" xy="98,196" pivot="0.5,0" anchor="true" size="106,36" fontSize="26" color="#fdedbe" text="赵钱孙李"/>
+    <component id="n2_m9wm" name="comRewardItem" src="wet2tae" fileName="components/ComRewardItem.xml" xy="0,0" pivot="0.5,0.45"/>
+    <graph id="n6_wet2" name="holder" xy="97,97" size="1,1" touchable="false" type="rect"/>
   </displayList>
+  <transition name="t0">
+    <item time="0" type="Scale" target="n2_m9wm" tween="true" startValue="0,0" endValue="1,1" duration="4" ease="Linear"/>
+  </transition>
 </component>

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

@@ -186,6 +186,7 @@
     <image id="ohuntac" name="zhuxian_shuoto.png" path="/imagesExport/" exported="true"/>
     <image id="ohuntad" name="zhangjie_bg_1.jpg" path="/bgimg/" exported="true" atlas="alone_npot"/>
     <movieclip id="lj7ea8" name="MovieClip1.jta" path="/effect/"/>
+    <component id="wet2tae" name="ComRewardItem.xml" path="/components/"/>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\CommonGame" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>

+ 77 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CommonGame/UI_ComRewardItem.cs

@@ -0,0 +1,77 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.CommonGame
+{
+    public partial class UI_ComRewardItem
+    {
+        public GComponent target;
+        public GLoader m_loaIcon;
+        public GTextField m_txtCount;
+        public GTextField m_txtName;
+        public const string URL = "ui://eg2y0ldpwet2tae";
+        public const string PACKAGE_NAME = "CommonGame";
+        public const string RES_NAME = "ComRewardItem";
+        private static UI_ComRewardItem _proxy;
+
+        public static UI_ComRewardItem Create(GObject gObject = null)
+        {
+            var ui = new UI_ComRewardItem();
+            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_ComRewardItem Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_ComRewardItem();
+            }
+            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_loaIcon = (GLoader)comp.GetChild("loaIcon");
+            m_txtCount = (GTextField)comp.GetChild("txtCount");
+            m_txtName = (GTextField)comp.GetChild("txtName");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_loaIcon = null;
+            m_txtCount = null;
+            m_txtName = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CommonGame/UI_ComRewardItem.cs.meta

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

+ 10 - 9
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CommonGame/UI_ListRewardItem.cs

@@ -7,9 +7,9 @@ namespace UI.CommonGame
     public partial class UI_ListRewardItem
     {
         public GComponent target;
-        public GLoader m_loaIcon;
-        public GTextField m_txtCount;
-        public GTextField m_txtName;
+        public UI_ComRewardItem m_comRewardItem;
+        public GGraph m_holder;
+        public Transition m_t0;
         public const string URL = "ui://eg2y0ldpm9wm8u";
         public const string PACKAGE_NAME = "CommonGame";
         public const string RES_NAME = "ListRewardItem";
@@ -57,15 +57,16 @@ namespace UI.CommonGame
 
         private void Init(GComponent comp)
         {
-            m_loaIcon = (GLoader)comp.GetChild("loaIcon");
-            m_txtCount = (GTextField)comp.GetChild("txtCount");
-            m_txtName = (GTextField)comp.GetChild("txtName");
+            m_comRewardItem = (UI_ComRewardItem)UI_ComRewardItem.Create(comp.GetChild("comRewardItem"));
+            m_holder = (GGraph)comp.GetChild("holder");
+            m_t0 = comp.GetTransition("t0");
         }
         public void Dispose(bool disposeTarget = false)
         {
-            m_loaIcon = null;
-            m_txtCount = null;
-            m_txtName = null;
+            m_comRewardItem.Dispose();
+            m_comRewardItem = null;
+            m_holder = null;
+            m_t0 = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 22 - 4
GameClient/Assets/Game/HotUpdate/Views/CommonGame/RewardView.cs

@@ -14,9 +14,17 @@ namespace GFGGame
 
         private Action onSuccess = null;
 
+        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()
@@ -27,7 +35,7 @@ namespace GFGGame
             this.viewCom.Center();
             this.modal = true;
 
-            _ui.m_listReward.SetVirtual();
+            // _ui.m_listReward.SetVirtual();
             _ui.m_listReward.itemRenderer = RenderListRewardItem;
             _ui.m_listReward.onClickItem.Add(OnClickListReward);
 
@@ -61,10 +69,20 @@ namespace GFGGame
             obj.data = _listItemDatas[index];
             UI_ListRewardItem item = UI_ListRewardItem.Proxy(obj);
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_listItemDatas[index].id);
-            item.m_txtName.text = itemCfg.name;
+            item.m_comRewardItem.m_txtName.text = itemCfg.name;
             // item.m_txtCount.text = _listItemDatas[index].num==1?"": string.Format("x{0}", _listItemDatas[index].num);
-            item.m_txtCount.text = string.Format("x{0}", _listItemDatas[index].num);
-            item.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
+            item.m_comRewardItem.m_txtCount.text = string.Format("x{0}", _listItemDatas[index].num);
+            item.m_comRewardItem.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
+            string resPath = ResPathUtil.GetViewEffectPath("ui_ck", "ui_ck_zl");
+            int childIndex = _ui.m_listReward.ItemIndexToChildIndex(index);
+            // if (_effects.Count <= index)
+            // {
+            //     GameObject gameObject0;
+            //     GoWrapper wrapper0;
+            //     SceneController.AddObjectToView(null, null, item.m_holder, resPath, out gameObject0, out wrapper0);
+            //     _effects.Add(gameObject0);
+            //     item.m_t0.Play();
+            // }
         }
         private void OnClickListReward(EventContext context)
         {

+ 7 - 3
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxCardView.cs

@@ -48,9 +48,13 @@ namespace GFGGame
             List<ItemData> rewards = new List<ItemData>(((this.viewData as object[])[0] as List<ItemData>));
             _rewardList.AddRange(rewards);
 
-            int[][] bonus = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.luckyBoxId).bonusArr;
-            List<ItemData> itemDatas = ItemUtil.CreateItemDataList(bonus, LuckyBoxDataManager.Instance.times);
-            _rewardList.AddRange(itemDatas);
+            if (LuckyBoxDataManager.Instance.luckyBoxId > 0)
+            {
+                int[][] bonus = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.luckyBoxId).bonusArr;
+                List<ItemData> itemDatas = ItemUtil.CreateItemDataList(bonus, LuckyBoxDataManager.Instance.times);
+                _rewardList.AddRange(itemDatas);
+                LuckyBoxDataManager.Instance.luckyBoxId = 0;
+            }
 
             _type = (int)(this.viewData as object[])[1];
             _ui.m_btnPass.visible = _type == (int)FirstGetCardViewType.JUMP ? true : false;

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