Kaynağa Gözat

飞行单位x轴方向被击飞减速调整

LAPTOP-OM1V99U2\永远de小亡灵 11 ay önce
ebeveyn
işleme
5640944ce4

+ 1 - 1
ActionTowerDefense/Assets/Resources/Prefab/Enemy_Arrow.prefab

@@ -1069,7 +1069,7 @@ MonoBehaviour:
   isDamageReduction: 0
   reductionDegree: 0
   reductionEffect: {fileID: 0}
-  decelerationRatio: 2
+  decelerationRatio: 1
   comaTime: 5
   pastComaTime: 0
   floatState: 0

+ 4 - 3
ActionTowerDefense/Assets/Scripts/Demonic.cs

@@ -527,11 +527,12 @@ public class Demonic : MoveCharacter
                     }
                     else
                     {
-                        vel += Vector3.up * extraFallGravity * Time.deltaTime;
+                        vel.y += extraFallGravity * Time.deltaTime;
+                        vel.x -= vel.x * decelerationRatio * Time.deltaTime;
                     }
 
-                    vel.y = vel.y * (1 - decelerationRatio * Time.deltaTime);
-                    vel.x = vel.x * (1 - decelerationRatio * Time.deltaTime);
+                    //vel.y = vel.y * (1 - decelerationRatio * Time.deltaTime);
+                    //vel.x = vel.x * (1 - decelerationRatio * Time.deltaTime);
                     rb.velocity = vel;
                 }
                 else

+ 4 - 3
ActionTowerDefense/Assets/Scripts/Enemy.cs

@@ -453,11 +453,12 @@ public class Enemy : MoveCharacter
                     }
                     else
                     {
-                        vel += Vector3.up * extraFallGravity * Time.deltaTime;
+                        vel.y += extraFallGravity * Time.deltaTime;
+                        vel.x -= vel.x * decelerationRatio * Time.deltaTime;
                     }
 
-                    vel.y = vel.y * (1 - decelerationRatio * Time.deltaTime);
-                    vel.x = vel.x * (1 - decelerationRatio * Time.deltaTime);
+                    //vel.y = vel.y * (1 - decelerationRatio * Time.deltaTime);
+                    //vel.x = vel.x * (1 - decelerationRatio * Time.deltaTime);
                     rb.velocity = vel;
                 }
                 else