zhaoyang 2 年之前
父節點
當前提交
30fff9362a

+ 1 - 1
FGUIProject/assets/LuckyBox/components/ComCost.xml

@@ -3,7 +3,7 @@
   <displayList>
   <displayList>
     <image id="n28_vek8" name="n28" src="volstbs" fileName="imageNews/zx_jindu_bg.png" xy="-7,4" size="195,34"/>
     <image id="n28_vek8" name="n28" src="volstbs" fileName="imageNews/zx_jindu_bg.png" xy="-7,4" size="195,34"/>
     <loader id="n29_vek8" name="loaCost" xy="57,3" pivot="0.5,0.5" size="35,35" group="n30_duuf" aspect="true" url="ui://eg2y0ldpq08x6" fill="scale"/>
     <loader id="n29_vek8" name="loaCost" xy="57,3" pivot="0.5,0.5" size="35,35" group="n30_duuf" aspect="true" url="ui://eg2y0ldpq08x6" fill="scale"/>
-    <text id="n14_ga16" name="txtCost" xy="112,19" pivot="0.5,0.5" anchor="true" size="20,44" group="n30_duuf" fontSize="32" color="#faf6e6" align="center" vAlign="middle" vars="true" autoSize="none" text="1"/>
+    <text id="n14_ga16" name="txtCost" xy="112,19" pivot="0.5,0.5" anchor="true" size="20,44" group="n30_duuf" fontSize="32" color="#faf6e6" align="center" vAlign="middle" vars="true" text="1"/>
     <group id="n30_duuf" name="n30" xy="57,-3" size="65,44" advanced="true" layout="hz" colGap="10" excludeInvisibles="true">
     <group id="n30_duuf" name="n30" xy="57,-3" size="65,44" advanced="true" layout="hz" colGap="10" excludeInvisibles="true">
       <relation target="" sidePair="center-center"/>
       <relation target="" sidePair="center-center"/>
     </group>
     </group>

+ 2 - 2
FGUIProject/assets/LuckyBox/components/ComHolder.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
-<component size="78,78">
+<component size="10,10">
   <displayList>
   <displayList>
-    <graph id="n5_tt1q" name="holder" xy="38,38" size="1,1"/>
+    <graph id="n5_tt1q" name="holder" xy="4,4" size="1,1"/>
   </displayList>
   </displayList>
 </component>
 </component>

+ 2 - 2
FGUIProject/assets/LuckyBox/components/ComStar.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
-<component size="78,78" pivot="0.5,0.5" anchor="true">
+<component size="10,10" pivot="0.5,0.5" anchor="true">
   <controller name="c1" pages="0,,1," selected="0"/>
   <controller name="c1" pages="0,,1," selected="0"/>
   <displayList>
   <displayList>
-    <component id="n8_t6j1" name="comLine" src="duufteb" fileName="components/ComponentLine.xml" xy="0,27"/>
+    <component id="n8_t6j1" name="comLine" src="duufteb" fileName="components/ComponentLine.xml" xy="5,5" pivot="0,0.5" anchor="true" size="850,24"/>
   </displayList>
   </displayList>
 </component>
 </component>

+ 4 - 2
FGUIProject/assets/LuckyBox/components/ComponentLine.xml

@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <component size="850,24" mask="n4_duuf">
 <component size="850,24" mask="n4_duuf">
   <displayList>
   <displayList>
-    <graph id="n2_o9gh" name="holder" xy="424,11" size="1,1"/>
-    <graph id="n4_duuf" name="grpMask" xy="0,0" size="850,24" type="rect"/>
+    <graph id="n2_o9gh" name="holder" xy="1200,11" size="1,1"/>
+    <graph id="n4_duuf" name="grpMask" xy="0,0" size="850,24" type="rect">
+      <relation target="" sidePair="width-width"/>
+    </graph>
   </displayList>
   </displayList>
 </component>
 </component>

+ 76 - 62
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxStarView.cs

@@ -6,6 +6,7 @@ using FairyGUI;
 using System.Threading;
 using System.Threading;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using System;
 using System;
+using Random = UnityEngine.Random;
 
 
 namespace GFGGame
 namespace GFGGame
 {
 {
@@ -22,7 +23,8 @@ namespace GFGGame
         // private List<GoWrapper> _wrappers1 = new List<GoWrapper>();
         // private List<GoWrapper> _wrappers1 = new List<GoWrapper>();
         private Dictionary<int, List<GameObject>> dicGameobj = new Dictionary<int, List<GameObject>>();
         private Dictionary<int, List<GameObject>> dicGameobj = new Dictionary<int, List<GameObject>>();
         private Dictionary<int, List<GoWrapper>> dicWraper = new Dictionary<int, List<GoWrapper>>();
         private Dictionary<int, List<GoWrapper>> dicWraper = new Dictionary<int, List<GoWrapper>>();
-
+        private List<GameObject> lineObj = new List<GameObject>();
+        private List<GoWrapper> lineWrapper = new List<GoWrapper>();
         private GObject curComStar;//当前选中的星星
         private GObject curComStar;//当前选中的星星
         private Vector2 lastPos;//鼠标的上一个位置,每颗星星初始时默认为Vector2.right;
         private Vector2 lastPos;//鼠标的上一个位置,每颗星星初始时默认为Vector2.right;
 
 
@@ -51,7 +53,7 @@ namespace GFGGame
                 UI_ComStar comStar = UI_ComStar.Proxy(star);
                 UI_ComStar comStar = UI_ComStar.Proxy(star);
                 for (int i = comStar.target.numChildren - 1; i >= 0; i--)
                 for (int i = comStar.target.numChildren - 1; i >= 0; i--)
                 {
                 {
-                    if (comStar.target.GetChildAt(i).name == "imgLine") continue;
+                    if (comStar.target.GetChildAt(i).name == "comLine") continue;
                     comStar.target.RemoveChildAt(i);
                     comStar.target.RemoveChildAt(i);
                 }
                 }
                 index++;
                 index++;
@@ -67,6 +69,10 @@ namespace GFGGame
                     SceneController.DestroyObjectFromView(value[i], wrappersValue[i]);
                     SceneController.DestroyObjectFromView(value[i], wrappersValue[i]);
                 }
                 }
             }
             }
+            for (int i = 0; i < lineObj.Count; i++)
+            {
+                SceneController.DestroyObjectFromView(lineObj[i], lineWrapper[i]);
+            }
             notClickComStars.Clear();
             notClickComStars.Clear();
             clickComStars.Clear();
             clickComStars.Clear();
             dicGameobj.Clear();
             dicGameobj.Clear();
@@ -98,8 +104,8 @@ namespace GFGGame
 
 
             _isLuckyBox = LuckyBoxDataManager.Instance.luckyBoxIds.IndexOf(LuckyBoxDataManager.Instance.currentBoxId) >= 0;
             _isLuckyBox = LuckyBoxDataManager.Instance.luckyBoxIds.IndexOf(LuckyBoxDataManager.Instance.currentBoxId) >= 0;
             _ui.m_ctrlRewardsType.selectedIndex = _isLuckyBox ? (LuckyBoxDataManager.Instance.currentBoxId - 1) : 0;
             _ui.m_ctrlRewardsType.selectedIndex = _isLuckyBox ? (LuckyBoxDataManager.Instance.currentBoxId - 1) : 0;
-            string resPath = string.Format("cj_tp_{0}", _isLuckyBox ? LuckyBoxDataManager.Instance.currentBoxId : 1);
-            _ui.m_bg.url = ResPathUtil.GetBgImgPath(resPath);
+            // string resPath = string.Format("cj_tp_{0}", _isLuckyBox ? LuckyBoxDataManager.Instance.currentBoxId : 1);
+            _ui.m_bg.url = ResPathUtil.GetBgImgPath("zx_bg");
 
 
             ResetStartView();
             ResetStartView();
             Timers.inst.AddUpdate(CheckGuide);
             Timers.inst.AddUpdate(CheckGuide);
@@ -124,22 +130,26 @@ namespace GFGGame
                 comStar.m_comLine.target.width = imgLineWidth;
                 comStar.m_comLine.target.width = imgLineWidth;
                 comStar.m_comLine.target.rotation = 0;
                 comStar.m_comLine.target.rotation = 0;
 
 
-
-                GComponent gcom = CreateEffect(comStar, 1, "ui_ck"); ;
+                float scale = Random.Range(0.5f, 1f);
+                float rotation = Random.Range(0, 360);
+                GComponent gcom = CreateEffect(comStar, 1, _isLuckyBox ? "STAR_Ready_Bule" : "STAR_Ready"); ;
                 gcom.visible = true;
                 gcom.visible = true;
                 comStar.target.AddChildAt(gcom, 1);
                 comStar.target.AddChildAt(gcom, 1);
+                gcom.scale = new Vector2(scale, scale);
+                gcom.rotation = rotation;
 
 
-                GComponent gcom1 = CreateEffect(comStar, 2, "ui_ck_dj");
+                GComponent gcom1 = CreateEffect(comStar, 2, _isLuckyBox ? "STAR_Bule" : "STAR");
                 gcom1.visible = false;
                 gcom1.visible = false;
                 comStar.target.AddChildAt(gcom1, 2);
                 comStar.target.AddChildAt(gcom1, 2);
+                gcom1.scale = new Vector2(scale, scale);
 
 
-                GComponent gcom2 = CreateEffect(comStar, 3, "ui_ck_xs");
-                gcom2.visible = false;
-                comStar.target.AddChildAt(gcom2, 3);
+                // GComponent gcom2 = CreateEffect(comStar, 3, "ui_ck_xs");
+                // gcom2.visible = false;
+                // comStar.target.AddChildAt(gcom2, 3);
 
 
-                GComponent gcom3 = CreateEffect(comStar, 4, "ui_ck_dj_2");
-                gcom3.visible = false;
-                comStar.target.AddChildAt(gcom3, 4);
+                // GComponent gcom3 = CreateEffect(comStar, 4, "ui_ck_dj_2");
+                // gcom3.visible = false;
+                // comStar.target.AddChildAt(gcom3, 4);
 
 
 
 
 
 
@@ -162,7 +172,7 @@ namespace GFGGame
             else
             else
             {
             {
                 gcom = UIPackage.CreateObject("LuckyBox", "ComHolder").asCom;
                 gcom = UIPackage.CreateObject("LuckyBox", "ComHolder").asCom;
-                string resPath = ResPathUtil.GetViewEffectPath("ui_ck", name);
+                string resPath = ResPathUtil.GetViewEffectPath("ui_LuckyBox", name);
                 SceneController.AddObjectToView(null, null, gcom.GetChild("holder").asGraph, resPath, out GameObject gameObject, out GoWrapper wrapper);
                 SceneController.AddObjectToView(null, null, gcom.GetChild("holder").asGraph, resPath, out GameObject gameObject, out GoWrapper wrapper);
                 if (!dicGameobj.ContainsKey(index))
                 if (!dicGameobj.ContainsKey(index))
                 {
                 {
@@ -208,9 +218,13 @@ namespace GFGGame
                     }
                     }
                     UI_ComStar comStar = UI_ComStar.Proxy(comStars[i]);
                     UI_ComStar comStar = UI_ComStar.Proxy(comStars[i]);
                     comStar.target.GetChildAt(2).asCom.visible = true;
                     comStar.target.GetChildAt(2).asCom.visible = true;
-                    comStar.target.GetChildAt(1).asCom.visible = false;
+                    // comStar.target.GetChildAt(1).asCom.visible = false;
+                    string resPath = ResPathUtil.GetViewEffectPath("ui_LuckyBox", _isLuckyBox ? "LINE_Bule" : "LINE");
+                    SceneController.AddObjectToView(null, null, comStar.m_comLine.m_holder, resPath, out GameObject gameObject, out GoWrapper wrapper);
+                    lineObj.Add(gameObject);
+                    lineWrapper.Add(wrapper);
                     UI_ComStar.ProxyEnd();
                     UI_ComStar.ProxyEnd();
-                    // comStar.m_c1.selectedIndex = 1;
+
                     curComStar = comStars[i];
                     curComStar = comStars[i];
                     lastPos = Vector2.right;
                     lastPos = Vector2.right;
 
 
@@ -261,55 +275,55 @@ namespace GFGGame
             }
             }
             else
             else
             {
             {
-                CheckNotClickComStar();
-                SetComStarDarken();
+                // CheckNotClickComStar();
+                // SetComStarDarken();
                 RemoveListener();
                 RemoveListener();
-                Timers.inst.Add(1f, 1, SetClickComStarAni);
-
-            }
-        }
-        private void CheckNotClickComStar()
-        {
-            int index = 0;
-            GObject star = _ui.target.GetChild(string.Format("comStar{0}_{1}_{2}", _ui.m_ctrlBuyType.selectedIndex, _ui.m_ctrlRewardsType.selectedIndex, index));
-
-            while (star != null && star.visible == true)
-            {
-                if (clickComStars.IndexOf(star) < 0)
-                {
-                    notClickComStars.Add(star);
-                }
-                index++;
-                star = _ui.target.GetChild(string.Format("comStar{0}_{1}_{2}", _ui.m_ctrlBuyType.selectedIndex, _ui.m_ctrlRewardsType.selectedIndex, index));
-            }
-        }
-
-        private void SetComStarDarken()
-        {
-
-            for (int i = 0; i < notClickComStars.Count; i++)
-            {
-                UI_ComStar notClickComStar = UI_ComStar.Proxy(notClickComStars[i]);
-                notClickComStar.m_comLine.target.visible = false;
-                notClickComStar.target.GetChildAt(3).asCom.visible = true;
-                notClickComStar.target.GetChildAt(1).asCom.visible = false;
-                UI_ComStar.ProxyEnd();
-
-            }
-
-        }
-
-        private void SetClickComStarAni(object param)
-        {
-            for (int i = 0; i < clickComStars.Count; i++)
-            {
-                UI_ComStar comStar = UI_ComStar.Proxy(clickComStars[i]);
-                comStar.target.GetChildAt(4).asCom.visible = true;
-                UI_ComStar.ProxyEnd();
-
+                // Timers.inst.Add(1f, 1, SetClickComStarAni);
+                Timers.inst.Add(0.5f, 1, SetEndEffect);
             }
             }
-            Timers.inst.Add(0.5f, 1, SetEndEffect);
         }
         }
+        // private void CheckNotClickComStar()
+        // {
+        //     int index = 0;
+        //     GObject star = _ui.target.GetChild(string.Format("comStar{0}_{1}_{2}", _ui.m_ctrlBuyType.selectedIndex, _ui.m_ctrlRewardsType.selectedIndex, index));
+
+        //     while (star != null && star.visible == true)
+        //     {
+        //         if (clickComStars.IndexOf(star) < 0)
+        //         {
+        //             notClickComStars.Add(star);
+        //         }
+        //         index++;
+        //         star = _ui.target.GetChild(string.Format("comStar{0}_{1}_{2}", _ui.m_ctrlBuyType.selectedIndex, _ui.m_ctrlRewardsType.selectedIndex, index));
+        //     }
+        // }
+
+        // private void SetComStarDarken()
+        // {
+
+        //     for (int i = 0; i < notClickComStars.Count; i++)
+        //     {
+        //         UI_ComStar notClickComStar = UI_ComStar.Proxy(notClickComStars[i]);
+        //         notClickComStar.m_comLine.target.visible = false;
+        //         notClickComStar.target.GetChildAt(3).asCom.visible = true;
+        //         notClickComStar.target.GetChildAt(1).asCom.visible = false;
+        //         UI_ComStar.ProxyEnd();
+
+        //     }
+
+        // }
+
+        // private void SetClickComStarAni(object param)
+        // {
+        //     for (int i = 0; i < clickComStars.Count; i++)
+        //     {
+        //         UI_ComStar comStar = UI_ComStar.Proxy(clickComStars[i]);
+        //         comStar.target.GetChildAt(4).asCom.visible = true;
+        //         UI_ComStar.ProxyEnd();
+
+        //     }
+        //     Timers.inst.Add(0.5f, 1, SetEndEffect);
+        // }
         private void SetEndEffect(object param)
         private void SetEndEffect(object param)
         {
         {
             _ui.m_effEnd.visible = true;
             _ui.m_effEnd.visible = true;

二進制
GameClient/Assets/ResIn/UI/LuckyBox/LuckyBox_fui.bytes