Эх сурвалжийг харах

分解tab自动贴近原件

zhaoyang 3 жил өмнө
parent
commit
c0b11e708a

+ 7 - 2
FGUIProject/assets/ClothingDecompose/ClothingDecomposeUI.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1080,1920">
-  <controller name="c1" pages="0,,1,,2,,3," selected="0"/>
+  <controller name="c1" pages="0,,1,,2,,3," selected="3"/>
   <displayList>
     <graph id="n24_qyr6" name="n24" xy="0,0" size="1080,1920" alpha="0.7" type="rect" lineSize="0" fillColor="#ff000000">
       <relation target="" sidePair="width-width,height-height"/>
@@ -13,7 +13,12 @@
     <component id="n28_cb92" name="valueBar" src="v3541v" fileName="components/ComponentValueBar.xml" pkg="eg2y0ldp" xy="125,90"/>
     <component id="n0_wlc2" name="btnBack" src="9xlo8" fileName="components/ButtonBack1.xml" pkg="eg2y0ldp" xy="35,80"/>
     <component id="n1_wlc2" name="btnRule" src="wlc21" fileName="components/Button1.xml" xy="975,194"/>
-    <component id="n2_wlc2" name="comBtnTab" src="qyr6v" fileName="components/ComBtnTab.xml" xy="100,343" size="880,63"/>
+    <list id="n29_ez2u" name="listTab" xy="100,343" size="880,63" layout="row" overflow="scroll" scroll="horizontal" scrollBarFlags="2" colGap="12">
+      <item url="ui://h9mv1l71wlc22" icon="ui://h9mv1l71qyr6j" selectedIcon="ui://h9mv1l71qyr6e"/>
+      <item url="ui://h9mv1l71wlc22" icon="ui://h9mv1l71qyr6i" selectedIcon="ui://h9mv1l71qyr6d"/>
+      <item url="ui://h9mv1l71wlc22" icon="ui://h9mv1l71qyr6h" selectedIcon="ui://h9mv1l71qyr6k"/>
+      <item url="ui://h9mv1l71wlc22" icon="ui://h9mv1l71qyr6g" selectedIcon="ui://h9mv1l71qyr6u"/>
+    </list>
     <list id="n10_wlc2" name="list" xy="76,445" size="928,643" layout="flow_hz" selectionMode="multipleSingleClick" overflow="scroll" lineGap="45" colGap="25" defaultItem="ui://h9mv1l71hvn0a" align="center">
       <item/>
       <item/>

+ 1 - 1
FGUIProject/assets/ClothingDecompose/components/ComBtnTab.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<component size="1056,63" overflow="scroll" scroll="horizontal">
+<component size="1056,63" overflow="scroll" scroll="horizontal" scrollBarFlags="2">
   <controller name="c1" pages="0,,1,,2,,3," selected="0"/>
   <displayList>
     <component id="n2_wlc2" name="btnRarity0" src="wlc22" fileName="components/Button2.xml" xy="0,0" size="255,63">

+ 3 - 4
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ClothingDecompose/UI_ClothingDecomposeUI.cs

@@ -12,7 +12,7 @@ namespace UI.ClothingDecompose
         public GComponent m_valueBar;
         public GButton m_btnBack;
         public GButton m_btnRule;
-        public UI_ComBtnTab m_comBtnTab;
+        public GList m_listTab;
         public GList m_list;
         public GTextField m_txtNone;
         public GTextField m_txtShow;
@@ -73,7 +73,7 @@ namespace UI.ClothingDecompose
             m_valueBar = (GComponent)comp.GetChild("valueBar");
             m_btnBack = (GButton)comp.GetChild("btnBack");
             m_btnRule = (GButton)comp.GetChild("btnRule");
-            m_comBtnTab = (UI_ComBtnTab)UI_ComBtnTab.Create(comp.GetChild("comBtnTab"));
+            m_listTab = (GList)comp.GetChild("listTab");
             m_list = (GList)comp.GetChild("list");
             m_txtNone = (GTextField)comp.GetChild("txtNone");
             m_txtShow = (GTextField)comp.GetChild("txtShow");
@@ -90,8 +90,7 @@ namespace UI.ClothingDecompose
             m_valueBar = null;
             m_btnBack = null;
             m_btnRule = null;
-            m_comBtnTab.Dispose();
-            m_comBtnTab = null;
+            m_listTab = null;
             m_list = null;
             m_txtNone = null;
             m_txtShow = null;

+ 0 - 83
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ClothingDecompose/UI_ComBtnTab.cs

@@ -1,83 +0,0 @@
-/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
-
-using FairyGUI;
-
-namespace UI.ClothingDecompose
-{
-    public partial class UI_ComBtnTab
-    {
-        public GComponent target;
-        public Controller m_c1;
-        public GButton m_btnRarity0;
-        public GButton m_btnRarity1;
-        public GButton m_btnRarity2;
-        public GButton m_btnRarity3;
-        public const string URL = "ui://h9mv1l71qyr6v";
-        public const string PACKAGE_NAME = "ClothingDecompose";
-        public const string RES_NAME = "ComBtnTab";
-        private static UI_ComBtnTab _proxy;
-
-        public static UI_ComBtnTab Create(GObject gObject = null)
-        {
-            var ui = new UI_ComBtnTab();
-            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_ComBtnTab Proxy(GObject gObject = null)
-        {
-            if(_proxy == null)
-            {
-                _proxy = new UI_ComBtnTab();
-            }
-            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_c1 = comp.GetController("c1");
-            m_btnRarity0 = (GButton)comp.GetChild("btnRarity0");
-            m_btnRarity1 = (GButton)comp.GetChild("btnRarity1");
-            m_btnRarity2 = (GButton)comp.GetChild("btnRarity2");
-            m_btnRarity3 = (GButton)comp.GetChild("btnRarity3");
-        }
-        public void Dispose(bool disposeTarget = false)
-        {
-            m_c1 = null;
-            m_btnRarity0 = null;
-            m_btnRarity1 = null;
-            m_btnRarity2 = null;
-            m_btnRarity3 = null;
-            if(disposeTarget && target != null)
-            {
-                target.RemoveFromParent();
-                target.Dispose();
-            }
-            target = null;
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ClothingDecompose/UI_ComBtnTab.cs.meta

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

+ 11 - 4
GameClient/Assets/Game/HotUpdate/Views/ClothingDecompose/ClothingDecomposeView.cs

@@ -35,10 +35,16 @@ namespace GFGGame
             _valueBarController = new ValueBarController(_ui.m_valueBar);
 
             _ui.m_btnBack.onClick.Add(OnClickBtnBack);
-            _ui.m_comBtnTab.m_btnRarity0.onClick.Add(() => OnClickBtnRarity(ConstDressRarity.Rarity_FANPIN));
-            _ui.m_comBtnTab.m_btnRarity1.onClick.Add(() => OnClickBtnRarity(ConstDressRarity.Rarity_ZHENXI));
-            _ui.m_comBtnTab.m_btnRarity2.onClick.Add(() => OnClickBtnRarity(ConstDressRarity.Rarity_DIANCANG));
-            _ui.m_comBtnTab.m_btnRarity3.onClick.Add(() => OnClickBtnRarity(ConstDressRarity.Rarity_TIANYI));
+            // _ui.m_comBtnTab.m_btnRarity0.onClick.Add(() => OnClickBtnRarity(ConstDressRarity.Rarity_FANPIN));
+            // _ui.m_comBtnTab.m_btnRarity1.onClick.Add(() => OnClickBtnRarity(ConstDressRarity.Rarity_ZHENXI));
+            // _ui.m_comBtnTab.m_btnRarity2.onClick.Add(() => OnClickBtnRarity(ConstDressRarity.Rarity_DIANCANG));
+            // _ui.m_comBtnTab.m_btnRarity3.onClick.Add(() => OnClickBtnRarity(ConstDressRarity.Rarity_TIANYI));
+            _ui.m_listTab.onClickItem.Add((EventContext context) =>
+            {
+                int index = _ui.m_listTab.GetChildIndex(context.data as GObject);
+                // int rarity =ConstDressRarity.DressRarityList().GetByIndex(index);
+                OnClickBtnRarity(index + 1);
+            });
 
             _ui.m_btnSelect.onClick.Add(OnClickBtnSelect);
             _ui.m_btnRule.onClick.Add(OnClickBtnRule);
@@ -57,6 +63,7 @@ namespace GFGGame
         {
             base.OnShown();
             _ui.m_c1.selectedIndex = 0;
+            _ui.m_listTab.selectedIndex = 0;
             _valueBarController.OnShown();
             _valueBarController.Controller(6);
             OnClickBtnRarity(ConstDressRarity.Rarity_FANPIN);

BIN
GameClient/Assets/ResIn/UI/ClothingDecompose/ClothingDecompose_atlas0.png


BIN
GameClient/Assets/ResIn/UI/ClothingDecompose/ClothingDecompose_fui.bytes