972455782 1 рік тому
батько
коміт
db8abd149c

+ 8 - 8
Assets/Game_Hyperspace/Script/Move.cs

@@ -322,11 +322,11 @@ public class RelativeHor : Move
         for (int i = 0; i < gos.Count; i++)
         {
             var tempPos = i % 2 == 0 ? PosType.LeftDown : PosType.RightDown;
-            var randomPos = gos[i].GetRandomPos(tempPos);
+            var randomPos = gos[i].GetRandomPos(tempPos, 0.3f);
             int count = RamdomNum;
             while (IsUIBlock(gos[i], randomPos, MoveType.RelativeHor, false) || CheckOverLap(gos[i], randomPos, MoveType.RelativeHor, gos.Count) && count > 0)
             {
-                randomPos = gos[i].GetRandomPos(tempPos);
+                randomPos = gos[i].GetRandomPos(tempPos, 0.3f);
                 count--;
             }
             var go = gos[i];
@@ -383,12 +383,12 @@ public class Diagonal : Move
             else
                 posType = temp ? PosType.RightTop : PosType.RightDown;
 
-            var randomPos = gos[i].GetRandomPos(posType, 0.25f);
+            var randomPos = gos[i].GetRandomPos(posType, 0.25f, 0.25f);
 
             int count = RamdomNum;
             while (IsUIBlock(gos[i], randomPos, MoveType.Diagonal, false) && count > 0)
             {
-                randomPos = gos[i].GetRandomPos(posType, 0.25f);
+                randomPos = gos[i].GetRandomPos(posType, 0.25f, 0.25f);
                 count--;
             }
             var go = gos[i];
@@ -412,11 +412,11 @@ public class W : Move
         for (int i = 0; i < gos.Count; i++)
         {
             var tempPos = i % 2 == 0 ? PosType.LeftTop : PosType.LeftDown;
-            var randomPos = gos[i].GetRandomPos(tempPos, 0.25f);
+            var randomPos = gos[i].GetRandomPos(tempPos, 0.25f, 0.25f);
             int count = RamdomNum;
             while (IsUIBlock(gos[i], randomPos, MoveType.W, false) && count > 0)
             {
-                randomPos = gos[i].GetRandomPos(tempPos, 0.25f);
+                randomPos = gos[i].GetRandomPos(tempPos, 0.25f, 0.25f);
                 count--;
             }
             var go = gos[i];
@@ -455,11 +455,11 @@ public class W2 : Move
             var tempPos = temp[random];
             temp.RemoveAt(random);
 
-            var randomPos = gos[i].GetRandomPos(tempPos, 0.25f);
+            var randomPos = gos[i].GetRandomPos(tempPos, 0.25f, 0.25f);
             int count = RamdomNum;
             while (IsUIBlock(gos[i], randomPos, MoveType.W2, false) && count > 0)
             {
-                randomPos = gos[i].GetRandomPos(tempPos, 0.25f);
+                randomPos = gos[i].GetRandomPos(tempPos, 0.25f, 0.25f);
                 count--;
             }
             var go = gos[i];

+ 3 - 3
Assets/Game_Hyperspace/Script/SpineAnimationLoader.cs

@@ -123,10 +123,10 @@ public class SpineAnimationLoader : MonoBehaviour
     /// <summary>
     /// 随机一个坐标
     /// </summary>
-    public Vector2 GetRandomPos(PosType posType = PosType.Random, float rate = 0)
+    public Vector2 GetRandomPos(PosType posType = PosType.Random, float rateX = 0, float rateY = 0)
     {
-        float paddingWRate = rate == 0 ? 0.45f : rate;
-        float paddingHRate = rate == 0 ? 0.45f : rate;
+        float paddingWRate = rateX == 0 ? 0.45f : rateX;
+        float paddingHRate = rateY == 0 ? 0.45f : rateY;
         var canvasSize = GeneratingTarget.gm.GetCanvasSize();
         ScreenWidth = canvasSize.x;
         ScreenHeight = canvasSize.y;