wgl 6 mesiacov pred
rodič
commit
75af4482a2

+ 20 - 11
ActionTowerDefense/Assets/Scripts/Characters/AttributeStatus.cs

@@ -23,8 +23,7 @@ public class AttributeStatus : MonoBehaviour
     private HitFeedbackSystem hitFeedbackSystem;
 
     //behit参数
-    [HideInInspector] public bool haveNewSpecialStates;
-
+    [DisplayOnly] public bool canChangeHitStun;
     [DisplayOnly] public SpecialState curSpecialStates = SpecialState.Null;
 
     [LabelText("控制时间")] [DisplayOnly] public float attributeTime;
@@ -96,13 +95,15 @@ public class AttributeStatus : MonoBehaviour
 
     public void AddSpecialState(AttackInfo attackInfo, Character attackFrom)
     {
-        if (!haveNewSpecialStates)
+        if (canChangeHitStun)
         {
+            canChangeHitStun = false;
             hitFeedbackSystem.EnterHitStun(attackFrom);
             return;
         }
+        
         hitFeedbackSystem.canHitStun = false;
-        haveNewSpecialStates = false;
+        Debug.Log(curSpecialStates);
         switch (curSpecialStates)
         {
             case SpecialState.FloatState:
@@ -115,8 +116,10 @@ public class AttributeStatus : MonoBehaviour
                 }
                 break;
             case SpecialState.ShotDown:
+                Debug.Log(222);
                 if (!rb.useGravity)
                 {
+                    Debug.Log(111);
                     AddShotDown(attackInfo.shotDown, attackFrom.transform.position.x < character.transform.position.x ? -1 : 1);
                 }
                 break;
@@ -124,6 +127,7 @@ public class AttributeStatus : MonoBehaviour
                 AddWeak(attackInfo.weak);
                 break;
         }
+
     }
 
     //CharacterState为SpecialStatus时调用此函数
@@ -257,19 +261,24 @@ public class AttributeStatus : MonoBehaviour
     //判断优先级,ture为优先级高于当前控制
     public bool PriorityOrder(SpecialState specialState)
     {
-        if (curSpecialStates != SpecialState.Null && curSpecialStates >= specialState)
+        if (curSpecialStates == SpecialState.Null)
         {
             curSpecialStates = specialState;
-            haveNewSpecialStates = true;
             return true;
         }
-        if (curSpecialStates == SpecialState.Null)
+        else
         {
-            curSpecialStates = specialState;
-            haveNewSpecialStates = true;
-            return true;
+            if (curSpecialStates >= specialState)
+            {
+                curSpecialStates = specialState;
+                return true;
+            }
+            else
+            {
+                canChangeHitStun = true;
+                return false;
+            }
         }
-        return true;
     }
 
     //受到漂浮