Ver código fonte

修复击落后再次击落效果会造成落地伤害

wgl 5 meses atrás
pai
commit
d758c82fcf

+ 2 - 3
ActionTowerDefense/Assets/Scripts/Characters/AttributeStatus.cs

@@ -271,7 +271,7 @@ public class AttributeStatus : MonoBehaviour
                         break;
                     case 0:
                         Vector3 vel = rb.velocity;
-                        if (isFly && foot.TrigGround && vel.y <= 0.01f)
+                        if (foot.TrigGround && vel.y <= 0.01f)
                         {
                             vel = Vector3.zero;
                             character.ani.Play("weak", 0, 0);
@@ -285,7 +285,6 @@ public class AttributeStatus : MonoBehaviour
                         {
                             vel.x -= decelerationRatioX * Time.deltaTime;
                             vel.y -= decelerationRatioY * Time.deltaTime;
-                            isFly = true;
                         }
                         rb.velocity = vel;
                         break;
@@ -294,6 +293,7 @@ public class AttributeStatus : MonoBehaviour
                         if (attributeTime <= 0)
                         {
                             character.isAdjustHeight = 1;
+                            isFly = true;
                             OutSpecialState();
                         }
                         else
@@ -413,7 +413,6 @@ public class AttributeStatus : MonoBehaviour
         landingDamage = blowUp.landingDamage;
         hitState = 0;
         character.ani.Play("hitted", 0, 0);
-        isFly = false;
     }
 
     //Êܵ½»÷Âä