Ver Fonte

抽卡添加特效

zhaoyang há 3 anos atrás
pai
commit
498403b7f2

+ 1 - 7
FGUIProject/assets/LuckyBox/components/ComStar.xml

@@ -2,13 +2,7 @@
 <component size="78,78" pivot="0.5,0.5" anchor="true">
   <controller name="c1" pages="0,,1," selected="0"/>
   <displayList>
-    <image id="n4_l5nz" name="imgLine" src="l5nzp" fileName="images/cj_xk_xian.png" xy="36,34" pivot="0,0.5" size="10,12"/>
-    <image id="n3_l5nz" name="n3" src="l5nzo" fileName="images/cj_xk_yd.png" xy="15,15" pivot="0.5,0.5">
-      <gearDisplay controller="c1" pages="0"/>
-    </image>
-    <image id="n2_l5nz" name="n2" src="l5nzn" fileName="images/cj_xk_xx.png" xy="0,0" pivot="0.5,0.5">
-      <gearDisplay controller="c1" pages="1"/>
-    </image>
+    <image id="n4_l5nz" name="imgLine" src="l5nzp" fileName="images/cj_xk_xian.png" xy="38,33" pivot="0,0.5" size="2,12"/>
     <graph id="n5_tt1q" name="holder" xy="38,38" size="1,1">
       <gearDisplay controller="c1" pages="0"/>
     </graph>

BIN
FGUIProject/assets/LuckyBox/images/cj_xk_xian.png


+ 1 - 1
FGUIProject/assets/LuckyBox/package.xml

@@ -22,7 +22,7 @@
     <component id="l5nzm" name="LuckyBoxStarUI.xml" path="/" exported="true"/>
     <image id="l5nzn" name="cj_xk_xx.png" path="/images/"/>
     <image id="l5nzo" name="cj_xk_yd.png" path="/images/"/>
-    <image id="l5nzp" name="cj_xk_xian.png" path="/images/" scale="9grid" scale9grid="8,0,9,12"/>
+    <image id="l5nzp" name="cj_xk_xian.png" path="/images/" scale="9grid" scale9grid="5,0,30,12"/>
     <component id="l5nzq" name="ComStar.xml" path="/components/"/>
     <image id="vek8r" name="cj_bj_1.jpg" path="/images/" exported="true" atlas="alone_npot"/>
     <image id="vek8s" name="cj_ditua.png" path="/images/"/>

+ 23 - 2
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxStarView.cs

@@ -13,8 +13,10 @@ namespace GFGGame
         private UI_LuckyBoxStarUI _ui;
         private List<GObject> comStars = new List<GObject>();
 
-        private GameObject[] _effectObjs;
-        private GoWrapper[] _wrappers;
+        private List<GameObject> _gameObjects = new List<GameObject>();
+        private List<GoWrapper> _wrappers = new List<GoWrapper>();
+        private List<GameObject> _gameObjects1 = new List<GameObject>();
+        private List<GoWrapper> _wrappers1 = new List<GoWrapper>();
 
         private GObject curComStar;//当前选中的星星
         private Vector2 lastPos;//鼠标的上一个位置,每颗星星初始时默认为Vector2.right;
@@ -27,6 +29,11 @@ namespace GFGGame
         private bool isGuide = false;
         public override void Dispose()
         {
+            for (int i = 0; i < _gameObjects.Count; i++)
+            {
+                SceneController.DestroyObjectFromView(_gameObjects[i]);
+                SceneController.DestroyObjectFromView(_gameObjects1[i]);
+            }
             base.Dispose();
         }
 
@@ -71,6 +78,20 @@ namespace GFGGame
                 comStar.m_imgLine.width = imgLineWidth;
                 comStar.m_imgLine.rotation = 0;
 
+                GameObject gameObject = _gameObjects.Count > index ? _gameObjects[index] : null;
+                GoWrapper wrapper = _wrappers.Count > index ? _wrappers[index] : null;
+                string resPath = ResPathUtil.GetViewEffectPath("ui_ck", "ui_ck");
+                SceneController.AddObjectToView(gameObject, wrapper, comStar.m_holder, resPath, out gameObject, out wrapper);
+                if (_gameObjects.Count <= index) _gameObjects.Add(gameObject);
+                if (_wrappers.Count <= index) _wrappers.Add(wrapper);
+
+                GameObject gameObject1 = _gameObjects1.Count > index ? _gameObjects1[index] : null;
+                GoWrapper wrapper1 = _wrappers1.Count > index ? _wrappers1[index] : null;
+                string resPath1 = ResPathUtil.GetViewEffectPath("ui_ck", "ui_ck_dj");
+                SceneController.AddObjectToView(gameObject1, wrapper1, comStar.m_holder1, resPath1, out gameObject1, out wrapper1);
+                if (_gameObjects1.Count <= index) _gameObjects1.Add(gameObject);
+                if (_wrappers1.Count <= index) _wrappers1.Add(wrapper);
+
                 star.data = new Vector2(comStar.target.x, comStar.target.y);
                 comStars.Add(star);
 

BIN
GameClient/Assets/ResIn/UI/LuckyBox/LuckyBox_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/LuckyBox/LuckyBox_atlas0.png


BIN
GameClient/Assets/ResIn/UI/LuckyBox/LuckyBox_fui.bytes