LAPTOP-OM1V99U2\永远de小亡灵 11 сар өмнө
parent
commit
c5d5f80d49

+ 6 - 10
ActionTowerDefense/Assets/Scripts/Demonic.cs

@@ -521,17 +521,13 @@ public class Demonic : MoveCharacter
                         aniCollider.Play("Hurt", 0, 0);
                         aniCollider.Play("Hurt", 0, 0);
                     }
                     }
                     Vector3 vel = rb.velocity;
                     Vector3 vel = rb.velocity;
-                    if (!canFly)
+                    if (foot.TrigGround && vel.y < 0)
                     {
                     {
-                        if (foot.TrigGround && vel.y < 0)
-                        {
-                            vel.y = 0;
-                        }
-                        else
-                        {
-                            vel += Vector3.up * extraFallGravity * Time.deltaTime;
-                        }
-
+                        vel.y = 0;
+                    }
+                    else
+                    {
+                        vel += Vector3.up * extraFallGravity * Time.deltaTime;
                     }
                     }
 
 
                     vel.y = vel.y * (1 - decelerationRatio * Time.deltaTime);
                     vel.y = vel.y * (1 - decelerationRatio * Time.deltaTime);