Browse Source

修复击飞后不能击落问题

wgl 6 months ago
parent
commit
61e58ee667
1 changed files with 1 additions and 5 deletions
  1. 1 5
      ActionTowerDefense/Assets/Scripts/Characters/AttributeStatus.cs

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

@@ -256,7 +256,7 @@ public class AttributeStatus : MonoBehaviour
     //判断优先级,ture为优先级高于当前控制
     public bool PriorityOrder(SpecialState specialState,AttackInfo attackInfo,Character attackFrom)
     {
-        if (curSpecialStates != SpecialState.Null && curSpecialStates <= specialState)
+        if (curSpecialStates != SpecialState.Null && curSpecialStates >= specialState)
         {
             curSpecialStates = specialState;
             this.attackInfo = attackInfo;
@@ -293,7 +293,6 @@ public class AttributeStatus : MonoBehaviour
         height = UnityEngine.Random.Range(floatState.height.x, floatState.height.y);
         attributeTime = floatState.time * (1 - resistances.Float);
 
-        curSpecialStates = SpecialState.FloatState;
         character.ChangeState(CharacterState.SpecialStatus_Float);
     }
 
@@ -307,7 +306,6 @@ public class AttributeStatus : MonoBehaviour
             vec3.x = -vec3.x;
         }
         rb.AddForce(vec3 * blowUp.force * (1 - resistances.BlowUp), ForceMode.Impulse);
-        curSpecialStates = SpecialState.BlownUp;
         character.ani.Play("hitted",0,0);
         hitState = 0;
         character.ChangeState(CharacterState.SpecialStatus_BlowUp);
@@ -325,7 +323,6 @@ public class AttributeStatus : MonoBehaviour
         rb.useGravity = true;
         rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ;
         rb.AddForce(vec3 * shotDown.force * (1 - resistances.ShotDown), ForceMode.Impulse);
-        curSpecialStates = SpecialState.ShotDown;
         character.ani.Play("hitted", 0, 0);
         hitState = 0;
         character.ChangeState(CharacterState.SpecialStatus_ShotDown);
@@ -335,7 +332,6 @@ public class AttributeStatus : MonoBehaviour
     public void AddWeak(AttackInfo.Weak weak)
     {
         attributeTime = weak.time * (1 - resistances.Weak);
-        curSpecialStates = SpecialState.Weak;
         character.ani.Play("weak", 0, 0);
         character.ChangeState(CharacterState.SpecialStatus_Weak);
     }