Ver Fonte

击飞击落减速度方向出错

WGL há 3 meses atrás
pai
commit
e1922d203e

+ 8 - 1
ActionTowerDefense/Assets/Scripts/Characters/AttributeStatus.cs

@@ -310,7 +310,14 @@ public class AttributeStatus : MonoBehaviour
                         }
                         else
                         {
-                            vel.x -= decelerationRatioX * Time.deltaTime;
+                            if(vel.x > 0)
+                            {
+                                vel.x -= decelerationRatioX * Time.deltaTime;
+                            }
+                            else
+                            {
+                                vel.x += decelerationRatioX * Time.deltaTime;
+                            }
                             vel.y -= decelerationRatioY * Time.deltaTime;
                             isFly = true;
                         }