zhaoyang 3 vuotta sitten
vanhempi
commit
71f95ed87d

+ 6 - 2
FGUIProject/assets/Card/CardFosterUI.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<component size="1080,1920" scroll="horizontal">
+<component size="1080,1920" overflow="hidden" scroll="horizontal">
   <displayList>
     <loader id="n0_ojlz" name="bg" xy="0,-240" size="1080,2400" url="ui://eg2y0ldpj539i" autoSize="true">
       <relation target="" sidePair="center-center,middle-middle"/>
@@ -7,10 +7,14 @@
     <loader id="n75_sxk4" name="loaCard" xy="-180,0" pivot="0.5,0" size="1440,1920" url="ui://7l6lvkaysxk49j" fill="scaleMatchHeight" clearOnPublish="true">
       <relation target="" sidePair="height-height"/>
     </loader>
+    <component id="n77_qgxy" name="comImgCard" src="qgxy9r" fileName="ComImgCard.xml" xy="540,0" pivot="0.5,0" anchor="true">
+      <relation target="" sidePair="width-width,height-height"/>
+    </component>
     <component id="n73_sxk4" name="comCard" src="sxk49h" fileName="components/ComCardObj.xml" xy="540,0" pivot="0.5,0" anchor="true" size="1080,1920">
       <relation target="" sidePair="width-width,height-height"/>
     </component>
-    <loader id="n76_sxk4" name="loaListener" xy="0,0" size="1080,1920"/>
+    <loader id="n78_qgxy" name="loaListener" xy="0,0" size="1080,1920"/>
+    <loader id="n76_sxk4" name="loaListener1" xy="0,0" size="1080,1920"/>
     <component id="n71_lc71" name="ComFosterTop" src="j4c69e" fileName="components/ComFosterTop.xml" xy="0,0"/>
     <component id="n70_lc71" name="ComFosterBottom" src="j4c69d" fileName="components/ComFosterBottom.xml" xy="0,211">
       <relation target="" sidePair="bottom-bottom"/>

+ 8 - 0
FGUIProject/assets/Card/ComCardImgRes.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="1440,1920">
+  <displayList>
+    <loader id="n78_qgxy" name="loaCard" xy="0,0" size="1440,1920" url="ui://7l6lvkaysxk49j" fill="scaleFree">
+      <relation target="" sidePair="width-width,height-height"/>
+    </loader>
+  </displayList>
+</component>

+ 6 - 0
FGUIProject/assets/Card/ComImgCard.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="1080,1920" overflow="scroll" scroll="horizontal" scrollBarFlags="128">
+  <displayList>
+    <component id="n78_qgxy" name="ComCardImgRes" src="qgxy9s" fileName="ComCardImgRes.xml" xy="0,0" pivot="0.5,0"/>
+  </displayList>
+</component>

+ 2 - 0
FGUIProject/assets/Card/package.xml

@@ -97,6 +97,8 @@
     <image id="rhha9o" name="kp_sjsj_di_2.png" path="/images/"/>
     <image id="rhha9p" name="kp_sjsj_di_1.png" path="/images/" scale="9grid" scale9grid="26,26,52,52"/>
     <component id="rhha9q" name="ComSkillDiscribe.xml" path="/"/>
+    <component id="qgxy9r" name="ComImgCard.xml" path="/"/>
+    <component id="qgxy9s" name="ComCardImgRes.xml" path="/"/>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\Card" packageCount="2" genCode="true"/>
 </packageDescription>

+ 1 - 1
GameClient/Assets/Game/CSShare

@@ -1 +1 @@
-Subproject commit 17e5874dc0f677570e9a3131563e3b21f0e923c0
+Subproject commit b1ec2215b991c1308c7c67da8e918050e9bd8178

+ 7 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Card/UI_CardFosterUI.cs

@@ -9,8 +9,10 @@ namespace UI.Card
         public GComponent target;
         public GLoader m_bg;
         public GLoader m_loaCard;
+        public UI_ComImgCard m_comImgCard;
         public UI_ComCardObj m_comCard;
         public GLoader m_loaListener;
+        public GLoader m_loaListener1;
         public UI_ComFosterTop m_ComFosterTop;
         public UI_ComFosterBottom m_ComFosterBottom;
         public Transition m_t0;
@@ -64,8 +66,10 @@ namespace UI.Card
         {
             m_bg = (GLoader)comp.GetChild("bg");
             m_loaCard = (GLoader)comp.GetChild("loaCard");
+            m_comImgCard = (UI_ComImgCard)UI_ComImgCard.Create(comp.GetChild("comImgCard"));
             m_comCard = (UI_ComCardObj)UI_ComCardObj.Create(comp.GetChild("comCard"));
             m_loaListener = (GLoader)comp.GetChild("loaListener");
+            m_loaListener1 = (GLoader)comp.GetChild("loaListener1");
             m_ComFosterTop = (UI_ComFosterTop)UI_ComFosterTop.Create(comp.GetChild("ComFosterTop"));
             m_ComFosterBottom = (UI_ComFosterBottom)UI_ComFosterBottom.Create(comp.GetChild("ComFosterBottom"));
             m_t0 = comp.GetTransition("t0");
@@ -75,9 +79,12 @@ namespace UI.Card
         {
             m_bg = null;
             m_loaCard = null;
+            m_comImgCard.Dispose();
+            m_comImgCard = null;
             m_comCard.Dispose();
             m_comCard = null;
             m_loaListener = null;
+            m_loaListener1 = null;
             m_ComFosterTop.Dispose();
             m_ComFosterTop = null;
             m_ComFosterBottom.Dispose();

+ 71 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Card/UI_ComCardImgRes.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_ComCardImgRes
+    {
+        public GComponent target;
+        public GLoader m_loaCard;
+        public const string URL = "ui://7l6lvkayqgxy9s";
+        public const string PACKAGE_NAME = "Card";
+        public const string RES_NAME = "ComCardImgRes";
+        private static UI_ComCardImgRes _proxy;
+
+        public static UI_ComCardImgRes Create(GObject gObject = null)
+        {
+            var ui = new UI_ComCardImgRes();
+            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_ComCardImgRes Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_ComCardImgRes();
+            }
+            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_loaCard = (GLoader)comp.GetChild("loaCard");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_loaCard = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

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

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

+ 72 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Card/UI_ComImgCard.cs

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

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

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

+ 49 - 21
GameClient/Assets/Game/HotUpdate/Views/Card/CardFosterView.cs

@@ -35,7 +35,9 @@ namespace GFGGame
         private int _showExp = 0;
 
         private float _cardScale = 0.8f;
+        private bool showCard = false;
 
+        private Vector2 comCardImgResInitSize;
         public override void Dispose()
         {
             _valueBarController.Dispose();
@@ -80,7 +82,9 @@ namespace GFGGame
             _comFosterBottom.m_listShowCard.itemRenderer = RenderListShowCardItem;
             _comFosterBottom.m_listShowCard.onClickItem.Add(OnClickShowCardListItem);
 
-            _ui.m_loaCard.onClick.Add(OnClickLoaCard);
+            // _ui.m_loaCard.onClick.Add(OnClickLoaCard);
+            _ui.m_loaListener1.onClick.Add(OnClickLoaCard);
+            _ui.m_comImgCard.target.onClick.Add(OnClickLoaCard);
 
             _ui.m_loaListener.onClick.Add(OnClickComCard);
             _ui.m_comCard.target.onClick.Add(OnClickComCard);
@@ -95,7 +99,6 @@ namespace GFGGame
 
             EventAgent.AddEventListener(ConstMessage.CARD_UP_SKILL, UpdateUpSkillView);
             // EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, OnItemChangeListener);
-
         }
 
 
@@ -105,6 +108,7 @@ namespace GFGGame
             _cardData = CardDataManager.GetCardDataById((this.viewData as CardData).id);
 
             _cardScale = _ui.target.height * 0.8f / _ui.target.initHeight;
+            showCard = false;
             Input.multiTouchEnabled = false;
             this.ClearItemsCountList();
             this.UpdateCommon();
@@ -155,35 +159,33 @@ namespace GFGGame
             if (Versions.Contains(resPath))
             {
                 _cardObj = DressUpUtil.AddAnimationObj(resPath);
+                SceneController.AddObjectToView(_cardObj, _wrapper, _ui.m_comCard.m_comCardHolder.m_holder, resPath, out _cardObj, out _wrapper);
+
             }
 
             if (_cardObj != null)
             {
                 _ui.m_loaListener.visible = true;
+                _ui.m_loaListener1.visible = false;
                 _ui.m_comCard.target.visible = true;
                 _ui.m_loaCard.visible = false;
 
-                int scale = 100;
-                _cardObj.transform.localScale = new Vector3(scale, scale, scale);
-                if (_wrapper == null)
-                {
-                    _wrapper = new GoWrapper(_cardObj);
-                    _ui.m_comCard.m_comCardHolder.m_holder.SetNativeObject(_wrapper);
-                }
-                else
-                {
-                    _wrapper.wrapTarget = _cardObj;
-                }
                 _ui.m_comCard.target.scrollPane.SetPercX(0.5f, false);
                 _ui.m_comCard.target.SetScale(_cardScale, _cardScale);
             }
             else
             {
                 _ui.m_comCard.target.visible = false;
-                _ui.m_loaCard.visible = true;
+                _ui.m_loaCard.visible = false;
                 _ui.m_loaListener.visible = false;
-                _ui.m_loaCard.url = ResPathUtil.GetCardPath(_cardData.resources[_cardData.resIndex]);
-                _ui.m_loaCard.width = _ui.m_loaCard.image.width;
+                _ui.m_loaListener1.visible = true;
+                _ui.m_comImgCard.m_ComCardImgRes.m_loaCard.url = ResPathUtil.GetCardPath(_cardData.resources[_cardData.resIndex]);
+                comCardImgResInitSize = new Vector2(_ui.m_comImgCard.m_ComCardImgRes.m_loaCard.initWidth * 0.8f, _ui.m_comImgCard.m_ComCardImgRes.m_loaCard.initHeight * 0.8f);
+                _ui.m_comImgCard.target.scrollPane.SetPercX(0.5f, false);
+                _ui.m_comImgCard.m_ComCardImgRes.target.size = comCardImgResInitSize;
+
+                //SetSize(_ui.m_comImgCard.m_ComCardImgRes.m_loaCard.initWidth * _cardScale, _ui.m_comImgCard.m_ComCardImgRes.m_loaCard.initHeight * _cardScale);
+
             }
 
         }
@@ -627,17 +629,40 @@ namespace GFGGame
         }
         private void OnClickLoaCard()
         {
-
-            _ui.m_t0.Play(() =>
+            float scale = _ui.target.height / comCardImgResInitSize.y;
+            if (!showCard)
             {
-                ViewManager.Show(ViewName.CARD_SHOW_VIEW, _cardData, new object[] { ViewName.CARD_FOSTER_VIEW, _cardData });
+                _ui.m_loaListener1.visible = false;
+                // _ui.m_comImgCard.target.scrollPane.SetPercX(0.5f, true);
+                GTween.To(_ui.m_comImgCard.m_ComCardImgRes.target.size, comCardImgResInitSize * scale, 0.5f).SetTarget(_ui.m_comImgCard.m_ComCardImgRes).OnUpdate((GTweener t) =>
+                {
+                    _ui.m_comImgCard.m_ComCardImgRes.target.size = t.value.vec2;
+                });
+                _ui.m_t0.Play();
+                showCard = true;
+            }
+            else
+            {
+                _ui.m_loaListener1.visible = true;
+                _ui.m_comImgCard.target.scrollPane.SetPercX(0.5f, true);
+                GTween.To(_ui.m_comImgCard.m_ComCardImgRes.target.size, comCardImgResInitSize, 0.25f).SetTarget(_ui.m_comImgCard).OnUpdate((GTweener t) =>
+               {
+                   _ui.m_comImgCard.m_ComCardImgRes.target.size = t.value.vec2;
+               });
 
-            });
+                _ui.m_t1.Play();
+                showCard = false;
+            }
+            // _ui.m_t0.Play(() =>
+            // {
+            //     ViewManager.Show(ViewName.CARD_SHOW_VIEW, _cardData, new object[] { ViewName.CARD_FOSTER_VIEW, _cardData });
+
+            // });
         }
         private void OnClickComCard()
         {
 
-            if (_ui.m_comCard.target.scaleX != _cardScale)
+            if (showCard)
             {
                 _ui.m_loaListener.visible = true;
                 _ui.m_comCard.target.scrollPane.SetPercX(0.5f, true);
@@ -646,6 +671,8 @@ namespace GFGGame
                 _ui.m_t1.SetValue("scale", scale, scale);
                 _ui.m_t1.SetValue("normal", _cardScale, _cardScale);
                 _ui.m_t1.Play();
+                showCard = false;
+
             }
             else
             {
@@ -658,6 +685,7 @@ namespace GFGGame
                 _ui.m_t0.SetValue("normal", _cardScale, _cardScale);
 
                 _ui.m_t0.Play();
+                showCard = true;
 
             }
         }

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