wgl пре 5 месеци
родитељ
комит
3280a41ad3

+ 1 - 109
ActionTowerDefense/Assets/Animations/Player/PlayerCollider_Rush.anim

@@ -131,53 +131,6 @@ AnimationClip:
     path: SoulCollector
     classID: 65
     script: {fileID: 0}
-  - curve:
-      serializedVersion: 2
-      m_Curve:
-      - serializedVersion: 3
-        time: 0
-        value: 0
-        inSlope: Infinity
-        outSlope: Infinity
-        tangentMode: 103
-        weightedMode: 0
-        inWeight: 0
-        outWeight: 0
-      m_PreInfinity: 2
-      m_PostInfinity: 2
-      m_RotationOrder: 4
-    attribute: m_IsActive
-    path: SprintLinkTrigger
-    classID: 1
-    script: {fileID: 0}
-  - curve:
-      serializedVersion: 2
-      m_Curve:
-      - serializedVersion: 3
-        time: 0
-        value: 0
-        inSlope: Infinity
-        outSlope: Infinity
-        tangentMode: 103
-        weightedMode: 0
-        inWeight: 0
-        outWeight: 0
-      - serializedVersion: 3
-        time: 1
-        value: 1
-        inSlope: Infinity
-        outSlope: Infinity
-        tangentMode: 103
-        weightedMode: 0
-        inWeight: 0
-        outWeight: 0
-      m_PreInfinity: 2
-      m_PostInfinity: 2
-      m_RotationOrder: 4
-    attribute: m_IsActive
-    path: BeHitTrigger
-    classID: 1
-    script: {fileID: 0}
   - curve:
       serializedVersion: 2
       m_Curve:
@@ -224,20 +177,6 @@ AnimationClip:
     m_Extent: {x: 0, y: 0, z: 0}
   m_ClipBindingConstant:
     genericBindings:
-    - serializedVersion: 2
-      path: 4030085486
-      attribute: 2086281974
-      script: {fileID: 0}
-      typeID: 1
-      customType: 0
-      isPPtrCurve: 0
-    - serializedVersion: 2
-      path: 2600719108
-      attribute: 2086281974
-      script: {fileID: 0}
-      typeID: 1
-      customType: 0
-      isPPtrCurve: 0
     - serializedVersion: 2
       path: 3066340498
       attribute: 4197328169
@@ -300,7 +239,7 @@ AnimationClip:
     m_AdditiveReferencePoseClip: {fileID: 0}
     m_AdditiveReferencePoseTime: 0
     m_StartTime: 0
-    m_StopTime: 1
+    m_StopTime: 0
     m_OrientationOffsetY: 0
     m_Level: 0
     m_CycleOffset: 0
@@ -430,53 +369,6 @@ AnimationClip:
     path: SoulCollector
     classID: 65
     script: {fileID: 0}
-  - curve:
-      serializedVersion: 2
-      m_Curve:
-      - serializedVersion: 3
-        time: 0
-        value: 0
-        inSlope: Infinity
-        outSlope: Infinity
-        tangentMode: 103
-        weightedMode: 0
-        inWeight: 0
-        outWeight: 0
-      m_PreInfinity: 2
-      m_PostInfinity: 2
-      m_RotationOrder: 4
-    attribute: m_IsActive
-    path: SprintLinkTrigger
-    classID: 1
-    script: {fileID: 0}
-  - curve:
-      serializedVersion: 2
-      m_Curve:
-      - serializedVersion: 3
-        time: 0
-        value: 0
-        inSlope: Infinity
-        outSlope: Infinity
-        tangentMode: 103
-        weightedMode: 0
-        inWeight: 0
-        outWeight: 0
-      - serializedVersion: 3
-        time: 1
-        value: 1
-        inSlope: Infinity
-        outSlope: Infinity
-        tangentMode: 103
-        weightedMode: 0
-        inWeight: 0
-        outWeight: 0
-      m_PreInfinity: 2
-      m_PostInfinity: 2
-      m_RotationOrder: 4
-    attribute: m_IsActive
-    path: BeHitTrigger
-    classID: 1
-    script: {fileID: 0}
   - curve:
       serializedVersion: 2
       m_Curve:

+ 1 - 109
ActionTowerDefense/Assets/Animations/Player/PlayerCollider_Summon.anim

@@ -131,53 +131,6 @@ AnimationClip:
     path: SoulCollector
     classID: 65
     script: {fileID: 0}
-  - curve:
-      serializedVersion: 2
-      m_Curve:
-      - serializedVersion: 3
-        time: 0
-        value: 0
-        inSlope: Infinity
-        outSlope: Infinity
-        tangentMode: 103
-        weightedMode: 0
-        inWeight: 0
-        outWeight: 0
-      m_PreInfinity: 2
-      m_PostInfinity: 2
-      m_RotationOrder: 4
-    attribute: m_IsActive
-    path: SprintLinkTrigger
-    classID: 1
-    script: {fileID: 0}
-  - curve:
-      serializedVersion: 2
-      m_Curve:
-      - serializedVersion: 3
-        time: 0
-        value: 0
-        inSlope: Infinity
-        outSlope: Infinity
-        tangentMode: 103
-        weightedMode: 0
-        inWeight: 0
-        outWeight: 0
-      - serializedVersion: 3
-        time: 0.75
-        value: 1
-        inSlope: Infinity
-        outSlope: Infinity
-        tangentMode: 103
-        weightedMode: 0
-        inWeight: 0
-        outWeight: 0
-      m_PreInfinity: 2
-      m_PostInfinity: 2
-      m_RotationOrder: 4
-    attribute: m_IsActive
-    path: BeHitTrigger
-    classID: 1
-    script: {fileID: 0}
   m_PPtrCurves: []
   m_SampleRate: 60
   m_WrapMode: 0
@@ -186,20 +139,6 @@ AnimationClip:
     m_Extent: {x: 0, y: 0, z: 0}
   m_ClipBindingConstant:
     genericBindings:
-    - serializedVersion: 2
-      path: 4030085486
-      attribute: 2086281974
-      script: {fileID: 0}
-      typeID: 1
-      customType: 0
-      isPPtrCurve: 0
-    - serializedVersion: 2
-      path: 2600719108
-      attribute: 2086281974
-      script: {fileID: 0}
-      typeID: 1
-      customType: 0
-      isPPtrCurve: 0
     - serializedVersion: 2
       path: 3066340498
       attribute: 4197328169
@@ -248,7 +187,7 @@ AnimationClip:
     m_AdditiveReferencePoseClip: {fileID: 0}
     m_AdditiveReferencePoseTime: 0
     m_StartTime: 0
-    m_StopTime: 0.75
+    m_StopTime: 0
     m_OrientationOffsetY: 0
     m_Level: 0
     m_CycleOffset: 0
@@ -378,53 +317,6 @@ AnimationClip:
     path: SoulCollector
     classID: 65
     script: {fileID: 0}
-  - curve:
-      serializedVersion: 2
-      m_Curve:
-      - serializedVersion: 3
-        time: 0
-        value: 0
-        inSlope: Infinity
-        outSlope: Infinity
-        tangentMode: 103
-        weightedMode: 0
-        inWeight: 0
-        outWeight: 0
-      m_PreInfinity: 2
-      m_PostInfinity: 2
-      m_RotationOrder: 4
-    attribute: m_IsActive
-    path: SprintLinkTrigger
-    classID: 1
-    script: {fileID: 0}
-  - curve:
-      serializedVersion: 2
-      m_Curve:
-      - serializedVersion: 3
-        time: 0
-        value: 0
-        inSlope: Infinity
-        outSlope: Infinity
-        tangentMode: 103
-        weightedMode: 0
-        inWeight: 0
-        outWeight: 0
-      - serializedVersion: 3
-        time: 0.75
-        value: 1
-        inSlope: Infinity
-        outSlope: Infinity
-        tangentMode: 103
-        weightedMode: 0
-        inWeight: 0
-        outWeight: 0
-      m_PreInfinity: 2
-      m_PostInfinity: 2
-      m_RotationOrder: 4
-    attribute: m_IsActive
-    path: BeHitTrigger
-    classID: 1
-    script: {fileID: 0}
   m_EulerEditorCurves: []
   m_HasGenericRootTransform: 0
   m_HasMotionFloatCurves: 0

+ 10 - 12
ActionTowerDefense/Assets/Scripts/Characters/AttackController.cs

@@ -36,16 +36,12 @@ public class AttackInfo
     //漂浮
     [Serializable]public struct FloatState
     {
-        [LabelText("持续时间")]
-        public float time;   
-        [LabelText("上升最大耗时")]
-        public Vector2 upTime;    
-        [LabelText("往后退的速度")]
-        public Vector2 backSpeed;  
-        [LabelText("旋转速度")]
-        public Vector2 rotateSpeed; 
-        [LabelText("上升高度")]
-        public Vector2 height;  
+        [LabelText("持续时间")] public float time;   
+        [LabelText("上升最大耗时")] public Vector2 upTime;    
+        [LabelText("往后退的速度")] public Vector2 backSpeed;  
+        [LabelText("旋转速度")] public Vector2 rotateSpeed; 
+        [LabelText("上升高度")] public Vector2 height;
+        [LabelText("控制层级")] public int ControlOrder;
     }
     private bool ShowFloatStateValue() => attackEffect.Contains(AttackEffect.FloatState);
     [ShowIf("ShowFloatStateValue")][LabelText("漂浮参数")]
@@ -63,6 +59,7 @@ public class AttackInfo
         [LabelText("方向")] public Vector3 dir;
         [LabelText("力")] public float force;
         [LabelText("落地后眩晕时间")] public float time;
+        [LabelText("控制层级")] public int ControlOrder;
     }
     private bool ShowBlowUpValue() => attackEffect.Contains(AttackEffect.BlowUp);
     [ShowIf("ShowBlowUpValue")][LabelText("击飞参数")]
@@ -80,6 +77,7 @@ public class AttackInfo
         [LabelText("方向")] public Vector3 dir;
         [LabelText("力")] public float force;
         [LabelText("落地后眩晕时间")] public float time;
+        [LabelText("控制层级")] public int ControlOrder;
     }
     private bool ShowShotDownValue() => attackEffect.Contains(AttackEffect.ShotDown);
     [ShowIf("ShowShotDownValue")][LabelText("击落参数")]
@@ -88,8 +86,8 @@ public class AttackInfo
     //击晕
     [Serializable]public struct Weak
     {
-        [LabelText("持续时间")]
-        public float time;
+        [LabelText("持续时间")] public float time;
+        [LabelText("控制层级")] public int ControlOrder;
     }
     private bool ShowWeakValue() => attackEffect.Contains(AttackEffect.Weak);
     [ShowIf("ShowWeakValue")][LabelText("击晕参数")]

+ 21 - 14
ActionTowerDefense/Assets/Scripts/Characters/AttributeStatus.cs

@@ -54,6 +54,8 @@ public class AttributeStatus : MonoBehaviour
     [Serializable]
     public struct Resistances
     {
+        public int controlOrder;
+
         //控制效果抗性
         [Range(0, 1)]
         [LabelText("漂浮抗性")]
@@ -108,7 +110,7 @@ public class AttributeStatus : MonoBehaviour
                         {
                             break;
                         }
-                        if (PriorityOrder(SpecialState.FloatState))
+                        if (PriorityOrder(SpecialState.FloatState, attackInfo.floatState.ControlOrder))
                         {
                             attackEffect = AttackEffect.FloatState;
                         }
@@ -119,9 +121,9 @@ public class AttributeStatus : MonoBehaviour
                         {
                             break;
                         }
-                        if (rb.useGravity)
+                        if (!character.canFly)
                         {
-                            if (PriorityOrder(SpecialState.BlownUp))
+                            if (PriorityOrder(SpecialState.BlownUp, attackInfo.blowUp.ControlOrder))
                             {
                                 attackEffect = AttackEffect.BlowUp;
                             }
@@ -133,9 +135,9 @@ public class AttributeStatus : MonoBehaviour
                         {
                             break;
                         }
-                        if (!rb.useGravity)
+                        if (character.canFly)
                         {
-                            if (PriorityOrder(SpecialState.ShotDown))
+                            if (PriorityOrder(SpecialState.ShotDown, attackInfo.shotDown.ControlOrder))
                             {
                                 attackEffect = AttackEffect.ShotDown;
                             }
@@ -147,7 +149,7 @@ public class AttributeStatus : MonoBehaviour
                         {
                             break;
                         }
-                        if (PriorityOrder(SpecialState.Weak))
+                        if (PriorityOrder(SpecialState.Weak, attackInfo.weak.ControlOrder))
                         {
                             attackEffect = AttackEffect.Weak;
                         }
@@ -167,14 +169,10 @@ public class AttributeStatus : MonoBehaviour
                     //击飞
                     case AttackEffect.BlowUp:
                         AddBlowUp(attackInfo.blowUp, attackFrom.bodyTrans);
-                        //虾兵特殊攻击先留着
-                        //AddBlowUp(attackInfo.blowUp, attackFrom.transform.position.x < character.transform.position.x ? -1 : 1);
                         break;
                     //击落
                     case AttackEffect.ShotDown:
                         AddShotDown(attackInfo.shotDown, attackFrom.bodyTrans);
-                        //虾兵特殊攻击先留着
-                        //AddShotDown(attackInfo.shotDown, attackFrom.transform.position.x < character.transform.position.x ? -1 : 1);
                         break;
                     //击晕
                     case AttackEffect.Weak:
@@ -258,6 +256,8 @@ public class AttributeStatus : MonoBehaviour
             case SpecialState.ShotDown:
                 switch (hitState)
                 {
+                    case -1:
+                        break;
                     case 0:
                         Vector3 vel = rb.velocity;
                         if (isFly && foot.TrigGround && vel.y <= 0.01f)
@@ -322,8 +322,14 @@ public class AttributeStatus : MonoBehaviour
     }
 
     //判断优先级,ture为优先级高于当前控制
-    public bool PriorityOrder(SpecialState specialState)
+    public bool PriorityOrder(SpecialState specialState, int controlOrder)
     {
+        //控制层级小于控制抗性层级,该控制效果无效
+        if(controlOrder < resistances.controlOrder)
+        {
+            return false;
+        }
+
         if (curSpecialStates == SpecialState.Null)
         {
             curSpecialStates = specialState;
@@ -380,15 +386,16 @@ public class AttributeStatus : MonoBehaviour
         {
             vec3.x = -vec3.x;
         }
+        hitState = -1;
+        character.ChangeState(CharacterState.SpecialStatus_BlowUp);
+        character.ChangeStateText(CharacterState.SpecialStatus_BlowUp);
         rb.useGravity = true;
         rb.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ;
         rb.velocity = Vector3.zero;
         rb.AddForce(vec3 * blowUp.force * (1 - resistances.BlowUp), ForceMode.Impulse);
-        character.ani.Play("hitted", 0, 0);
         hitState = 0;
+        character.ani.Play("hitted", 0, 0);
         isFly = false;
-        character.ChangeState(CharacterState.SpecialStatus_BlowUp);
-        character.ChangeStateText(CharacterState.SpecialStatus_BlowUp);
     }
 
     //受到击落

+ 1 - 0
ActionTowerDefense/Assets/Scripts/Characters/MoveCharacter.cs

@@ -223,6 +223,7 @@ public class MoveCharacter : Character
     {
         if (invincibleTime > 0)
         {
+            attributeStatus.AddSpecialState(attackInfo, attackFrom);
             return;
         }
         screenReflectPresets.ScreenReflect(hitFeedbackSystem, attackInfo.attackValue - hitResistance);