瀏覽代碼

林冲第三下自己也顿帧

WGL 2 月之前
父節點
當前提交
0c409f2f58
共有 23 個文件被更改,包括 171 次插入128 次删除
  1. 11 0
      ActionTowerDefense/Assets/Resources/Prefab/View.prefab
  2. 3 3
      ActionTowerDefense/Assets/Scripts/Boss/Boss.cs
  3. 2 2
      ActionTowerDefense/Assets/Scripts/Boss/WaterGhost/WaterSprite.cs
  4. 4 4
      ActionTowerDefense/Assets/Scripts/Bullet.cs
  5. 3 3
      ActionTowerDefense/Assets/Scripts/Bullet_Ray.cs
  6. 1 1
      ActionTowerDefense/Assets/Scripts/Characters/AttackController.cs
  7. 4 4
      ActionTowerDefense/Assets/Scripts/Characters/AttackTrigger.cs
  8. 42 42
      ActionTowerDefense/Assets/Scripts/Characters/AttributeStatus.cs
  9. 9 2
      ActionTowerDefense/Assets/Scripts/Characters/BeHitTrigger.cs
  10. 1 1
      ActionTowerDefense/Assets/Scripts/Characters/Character.cs
  11. 1 0
      ActionTowerDefense/Assets/Scripts/Characters/Demonic.cs
  12. 1 0
      ActionTowerDefense/Assets/Scripts/Characters/Enemy.cs
  13. 27 13
      ActionTowerDefense/Assets/Scripts/Characters/HitFeedbackSystem.cs
  14. 7 8
      ActionTowerDefense/Assets/Scripts/Characters/MoveCharacter.cs
  15. 6 5
      ActionTowerDefense/Assets/Scripts/Characters/PlayerController.cs
  16. 3 3
      ActionTowerDefense/Assets/Scripts/Characters/Polliwog.cs
  17. 2 2
      ActionTowerDefense/Assets/Scripts/Conduct/BigSoldier.cs
  18. 5 5
      ActionTowerDefense/Assets/Scripts/Conduct/MagicBullet.cs
  19. 1 1
      ActionTowerDefense/Assets/Scripts/Spirits/ESpirits_Assassin.cs
  20. 21 21
      ActionTowerDefense/Assets/Scripts/Spirits/FloatEffect.cs
  21. 13 4
      ActionTowerDefense/Assets/Scripts/SystemReflect/ScreenReflectPresets.cs
  22. 2 2
      ActionTowerDefense/Assets/Scripts/Tower/EnemyTower.cs
  23. 2 2
      ActionTowerDefense/Assets/Scripts/Tower/Tower.cs

+ 11 - 0
ActionTowerDefense/Assets/Resources/Prefab/View.prefab

@@ -500,52 +500,63 @@ MonoBehaviour:
     - effect: 1
       level: 0
       frame: 4
+      attackFromHasFreezeFrame: 0
       time: 0
     - effect: 0
       level: 0
       frame: 0
+      attackFromHasFreezeFrame: 0
       time: 0
   - minX: 10
     effects:
     - effect: 0
       level: 1
       frame: 0
+      attackFromHasFreezeFrame: 0
       time: 0
     - effect: 1
       level: 0
       frame: 5
+      attackFromHasFreezeFrame: 0
       time: 4
     - effect: 2
       level: 0
       frame: 0
+      attackFromHasFreezeFrame: 0
       time: 1
   - minX: 20
     effects:
     - effect: 0
       level: 1
       frame: 0
+      attackFromHasFreezeFrame: 0
       time: 0
     - effect: 1
       level: 0
       frame: 4
+      attackFromHasFreezeFrame: 0
       time: 0
     - effect: 2
       level: 0
       frame: 0
+      attackFromHasFreezeFrame: 0
       time: 1
   - minX: 30
     effects:
     - effect: 0
       level: 2
       frame: 0
+      attackFromHasFreezeFrame: 0
       time: 0
     - effect: 1
       level: 12
       frame: 10
+      attackFromHasFreezeFrame: 1
       time: 0
     - effect: 2
       level: 1
       frame: 0
+      attackFromHasFreezeFrame: 0
       time: 1
 --- !u!114 &5446471053527330177
 MonoBehaviour:

+ 3 - 3
ActionTowerDefense/Assets/Scripts/Boss/Boss.cs

@@ -162,13 +162,13 @@ public class Boss : MoveCharacter
         curCategory = categories[0];
     }
 
-    public override void BeHit(AttackInfo attackInfo, Character attackFrom, int damage = -1)
+    public override void BeHit(AttackController.AttackMethod attackMethod, Character attackFrom, int damage = -1)
     {
         switch (bossState)
         {
             //唐켐제令
             case BossState.normal:
-                base.BeHit(attackInfo, attackFrom, damage);
+                base.BeHit(attackMethod, attackFrom, damage);
                 /*//댔켐제係
                 int damageData;
                 if (damage == -1)
@@ -190,7 +190,7 @@ public class Boss : MoveCharacter
                 break;
             //켐제令팎
             case BossState.weak:
-                base.BeHit(attackInfo, attackFrom, damage);
+                base.BeHit(attackMethod, attackFrom, damage);
                 if (hp > 0)
                 {
                     JudgeIfChangeBG();

+ 2 - 2
ActionTowerDefense/Assets/Scripts/Boss/WaterGhost/WaterSprite.cs

@@ -134,9 +134,9 @@ public class WaterSprite : Boss
         jumpMoveCS.OnJumpMove();
     }
 
-    public override void BeHit(AttackInfo attackInfo, Character attackFrom, int damage = -1)
+    public override void BeHit(AttackController.AttackMethod attackMethod, Character attackFrom, int damage = -1)
     {
-        base.BeHit(attackInfo, attackFrom, damage);
+        base.BeHit(attackMethod, attackFrom, damage);
         if (hp <= nextAimHP)
         {
             ChangeStage(BossStage.polliwog);

+ 4 - 4
ActionTowerDefense/Assets/Scripts/Bullet.cs

@@ -22,7 +22,7 @@ public class Bullet : MonoBehaviour
     
     [Header("组件")]
     public Character owner;
-    public AttackInfo attackInfo;
+    public AttackController.AttackMethod attackMethod;
     public Rigidbody rb;
     public List<BeHitTrigger> trigedObjs;
     public BulletType bulletType;
@@ -125,7 +125,7 @@ public class Bullet : MonoBehaviour
         isGetTarget = false;
         canAlwaysTrack = alwaysTrack;
         flyTime = 0;
-        attackInfo = own.attackController.curAttackMethod.attackInfo;
+        attackMethod = own.attackController.curAttackMethod;
     }
 
     private void GetEffectPos(Collider other)
@@ -167,11 +167,11 @@ public class Bullet : MonoBehaviour
                 trigedObjs.Add(hitTrigger);
                 if (Util.CheckCanHit(owner.tag, hitTrigger.owner.tag) && !hitTrigger.owner.isDie)
                 {
-                    hitTrigger.BeHit(attackInfo, owner);
+                    hitTrigger.BeHit(attackMethod, owner);
                     BeHitEffect(other, hitTrigger);
                     if (hitTrigger.owner.debugAttackFrom)
                     {
-                        hitTrigger.owner.DebugAttackFrom(owner.name, attackInfo.damage);
+                        hitTrigger.owner.DebugAttackFrom(owner.name, attackMethod.attackInfo.damage);
                     }
                     switch (bulletType)
                     {

+ 3 - 3
ActionTowerDefense/Assets/Scripts/Bullet_Ray.cs

@@ -196,11 +196,11 @@ public class Bullet_Ray : Bullet
                 if (Util.CheckCanHit(owner.tag, hitTrigger.owner.tag) && !hitTrigger.owner.isDie)
                 {
                     float dir = transform.position.x < hitTrigger.transform.position.x ? -1 : 1;
-                    hitTrigger.BeHit(attackInfo, owner);
+                    hitTrigger.BeHit(attackMethod, owner);
                     BeHitEffect(other, hitTrigger);
                     if (hitTrigger.owner.debugAttackFrom)
                     {
-                        hitTrigger.owner.DebugAttackFrom(owner.name, attackInfo.damage);
+                        hitTrigger.owner.DebugAttackFrom(owner.name, attackMethod.attackInfo.damage);
                     }
                     isGetTarget = true;
                     if (canStop && (hitTrigger.owner.gameObject.layer == 6 || hitTrigger.owner.gameObject.layer == 7))
@@ -240,6 +240,6 @@ public class Bullet_Ray : Bullet
         isGetTarget = false;
         canAlwaysTrack = alwaysTrack;
         flyTime = 0;
-        attackInfo = own.attackController.curAttackMethod.attackInfo;
+        attackMethod = own.attackController.curAttackMethod;
     }
 }

+ 1 - 1
ActionTowerDefense/Assets/Scripts/Characters/AttackController.cs

@@ -340,7 +340,7 @@ public class AttackController : MonoBehaviour
         }
 
         AttackTrigger attackTrigger = curAttackMethod.attackTrigger;
-        attackTrigger.attackInfo = curAttackMethod.attackInfo;
+        attackTrigger.attackMethod = curAttackMethod;
         switch (curAttackMethod.attackType)
         {
         

+ 4 - 4
ActionTowerDefense/Assets/Scripts/Characters/AttackTrigger.cs

@@ -19,7 +19,7 @@ public class AttackTrigger : MonoBehaviour
     [Header("¹¥»÷¶ÔÏó")]
     public List<BeHitTrigger> trigedObjs;
     [Header("¹¥»÷ÊôÐÔ")]
-    public AttackInfo attackInfo;
+    public AttackController.AttackMethod attackMethod;
     public Vector3 force;
     public bool changeHurt;
     public float repelValue;
@@ -43,10 +43,10 @@ public class AttackTrigger : MonoBehaviour
                     return;
                 }
                 trigedObjs.Add(hitTrigger);
-                hitTrigger.BeHit(attackInfo, owner);
+                hitTrigger.BeHit(attackMethod, owner);
                 if (hitTrigger.owner.debugAttackFrom)
                 {
-                    hitTrigger.owner.DebugAttackFrom(owner.name, attackInfo.damage);
+                    hitTrigger.owner.DebugAttackFrom(owner.name, attackMethod.attackInfo.damage);
                 }
                 if (owner.GetComponent<Demonic>())
                 {
@@ -67,7 +67,7 @@ public class AttackTrigger : MonoBehaviour
         if (isShoot)
         {
             CharacterColliders cc = GetComponentInParent<CharacterColliders>();
-            switch (attackInfo.attackMethod_Type)
+            switch (attackMethod.attackInfo.attackMethod_Type)
             {
                 case AttackMethod_Type.Attack_Summon:
                     cc.Attack_summonShootEvent(0);

+ 42 - 42
ActionTowerDefense/Assets/Scripts/Characters/AttributeStatus.cs

@@ -25,7 +25,7 @@ public class AttributeStatus : MonoBehaviour
 
     //behit参数
     [DisplayOnly] public SpecialState curSpecialStates = SpecialState.Null;
-    public AttackInfo attackInfo;
+    public AttackController.AttackMethod attackMethod;
 
     [LabelText("控制时间")] [DisplayOnly] public float attributeTime;
 
@@ -125,14 +125,14 @@ public class AttributeStatus : MonoBehaviour
         }
     }
 
-    public void AddSpecialState(AttackInfo attackInfo, Character attackFrom)
+    public void AddSpecialState(AttackController.AttackMethod attackMethod, Character attackFrom)
     {
-        if (attackInfo.attackEffect != null && attackInfo.attackEffect.Length > 0)
+        if (attackMethod.attackInfo.attackEffect != null && attackMethod.attackInfo.attackEffect.Length > 0)
         {
             AttackEffect attackEffect = AttackEffect.Null;
-            foreach (AttackEffect ae in attackInfo.attackEffect)
+            foreach (AttackEffect ae in attackMethod.attackInfo.attackEffect)
             {
-                switch (attackInfo.attackEffect[0])
+                switch (attackMethod.attackInfo.attackEffect[0])
                 {
                     /*控制*/
                     //漂浮
@@ -141,7 +141,7 @@ public class AttributeStatus : MonoBehaviour
                         {
                             break;
                         }
-                        if (PriorityOrder(SpecialState.FloatState, attackInfo.floatState.ControlOrder))
+                        if (PriorityOrder(SpecialState.FloatState, attackMethod.attackInfo.floatState.ControlOrder))
                         {
                             attackEffect = AttackEffect.FloatState;
                         }
@@ -154,7 +154,7 @@ public class AttributeStatus : MonoBehaviour
                         }
                         if (!character.nowCanFly)
                         {
-                            if (PriorityOrder(SpecialState.BlownUp, attackInfo.blowUp.ControlOrder))
+                            if (PriorityOrder(SpecialState.BlownUp,attackMethod.attackInfo.blowUp.ControlOrder))
                             {
                                 attackEffect = AttackEffect.BlowUp;
                             }
@@ -168,7 +168,7 @@ public class AttributeStatus : MonoBehaviour
                         }
                         if (character.nowCanFly || !character.canNotShotDown)
                         {
-                            if (PriorityOrder(SpecialState.ShotDown, attackInfo.shotDown.ControlOrder))
+                            if (PriorityOrder(SpecialState.ShotDown,attackMethod.attackInfo.shotDown.ControlOrder))
                             {
                                 attackEffect = AttackEffect.ShotDown;
                             }
@@ -180,7 +180,7 @@ public class AttributeStatus : MonoBehaviour
                         {
                             break;
                         }
-                        if (PriorityOrder(SpecialState.Weak, attackInfo.weak.ControlOrder))
+                        if (PriorityOrder(SpecialState.Weak,attackMethod.attackInfo.weak.ControlOrder))
                         {
                             attackEffect = AttackEffect.Weak;
                         }
@@ -195,29 +195,29 @@ public class AttributeStatus : MonoBehaviour
                     /*控制*/
                     //漂浮
                     case AttackEffect.FloatState:
-                        AddFloat(attackInfo);
+                        AddFloat(attackMethod);
                         break;
                     //击飞
                     case AttackEffect.BlowUp:
-                        AddBlowUp(attackInfo, attackFrom.bodyTrans);
+                        AddBlowUp(attackMethod, attackFrom.bodyTrans);
                         character.bodyCollider.layer = LayerMask.NameToLayer("BodyToPlatformCollider");
-                        if (attackInfo.blowUp.haveLandingDamage)
+                        if (attackMethod.attackInfo.blowUp.haveLandingDamage)
                         {
                             landingDamageFrom = attackFrom;
                         }
                         break;
                     //击落
                     case AttackEffect.ShotDown:
-                        AddShotDown(attackInfo, attackFrom.bodyTrans);
+                        AddShotDown(attackMethod, attackFrom.bodyTrans);
                         character.bodyCollider.layer = LayerMask.NameToLayer("BodyToPlatformCollider");
-                        if (attackInfo.shotDown.haveLandingDamage)
+                        if (attackMethod.attackInfo.shotDown.haveLandingDamage)
                         {
                             landingDamageFrom = attackFrom;
                         }
                         break;
                     //击晕
                     case AttackEffect.Weak:
-                        AddWeak(attackInfo);
+                        AddWeak(attackMethod);
                         break;
                 }
                 return;
@@ -320,21 +320,21 @@ public class AttributeStatus : MonoBehaviour
                             int landingDamage;
                             if (specialState == SpecialState.BlownUp)
                             {
-                                if (attackInfo.blowUp.haveLandingDamage)
+                                if (attackMethod.attackInfo.blowUp.haveLandingDamage)
                                 {
-                                    landingDamage = (int)(Mathf.Abs(transform.position.x - startFlyPos.x) * attackInfo.blowUp.landingDamageRate);
+                                    landingDamage = (int)(Mathf.Abs(transform.position.x - startFlyPos.x) * attackMethod.attackInfo.blowUp.landingDamageRate);
                                     if (landingDamage > 0)
                                     {
-                                        character.BeHit(attackInfo, landingDamageFrom, landingDamage);
+                                        character.BeHit(attackMethod, landingDamageFrom, landingDamage);
                                     }
                                 }
                             }
                             else
                             {
-                                if (attackInfo.shotDown.haveLandingDamage)
+                                if (attackMethod.attackInfo.shotDown.haveLandingDamage)
                                 {
-                                    landingDamage = attackInfo.shotDown.landingDamage;
-                                    character.BeHit(attackInfo, landingDamageFrom, landingDamage);
+                                    landingDamage = attackMethod.attackInfo.shotDown.landingDamage;
+                                    character.BeHit(attackMethod, landingDamageFrom, landingDamage);
                                 }
                             }
                             BounceEffect();
@@ -450,14 +450,14 @@ public class AttributeStatus : MonoBehaviour
     }
 
     //受到漂浮
-    public void AddFloat(AttackInfo attackInfo)
+    public void AddFloat(AttackController.AttackMethod attackMethod)
     {
         if (resistances.Float == 1)
         {
             return;
         }
-        this.attackInfo = attackInfo;
-        AttackInfo.FloatState floatState = attackInfo.floatState;
+        this.attackMethod = attackMethod;
+        AttackInfo.FloatState floatState = attackMethod.attackInfo.floatState;
         rb.isKinematic = false;
         rb.useGravity = false;
         floatingState = 1;
@@ -478,14 +478,14 @@ public class AttributeStatus : MonoBehaviour
     }
 
     //受到击飞
-    public void AddBlowUp(AttackInfo attackInfo, Transform attackFrom)
+    public void AddBlowUp(AttackController.AttackMethod attackMethod, Transform attackFrom)
     {
         if (resistances.BlowUp == 1)
         {
             return;
         }
-        this.attackInfo = attackInfo;
-        AttackInfo.BlowUp blowUp = attackInfo.blowUp;
+        this.attackMethod = attackMethod;
+        AttackInfo.BlowUp blowUp = attackMethod.attackInfo.blowUp;
         attributeTime = blowUp.time * (1 - resistances.BlowUp);
         Vector3 vec3 = new Vector3(
             blowUp.dir.x + UnityEngine.Random.Range(-blowUp.dirRandom.x / 2f, blowUp.dirRandom.x / 2f),
@@ -526,14 +526,14 @@ public class AttributeStatus : MonoBehaviour
     }
 
     //受到击落
-    public void AddShotDown(AttackInfo attackInfo, Transform attackFrom)
+    public void AddShotDown(AttackController.AttackMethod attackMethod, Transform attackFrom)
     {
         if (resistances.ShotDown == 1)
         {
             return;
         }
-        this.attackInfo = attackInfo;
-        AttackInfo.ShotDown shotDown = attackInfo.shotDown;
+        this.attackMethod = attackMethod;
+        AttackInfo.ShotDown shotDown = attackMethod.attackInfo.shotDown;
         attributeTime = shotDown.time * (1 - resistances.ShotDown);
         Vector3 vec3 = new Vector3(
             shotDown.dir.x + UnityEngine.Random.Range(-shotDown.dirRandom.x / 2f, shotDown.dirRandom.x / 2f),
@@ -568,14 +568,14 @@ public class AttributeStatus : MonoBehaviour
     }
 
     //受到击晕
-    public void AddWeak(AttackInfo attackInfo)
+    public void AddWeak(AttackController.AttackMethod attackMethod)
     {
         if (resistances.Weak == 1)
         {
             return;
         }
-        this.attackInfo = attackInfo;
-        AttackInfo.Weak weak = attackInfo.weak;
+        this.attackMethod = attackMethod;
+        AttackInfo.Weak weak = attackMethod.attackInfo.weak;
         attributeTime = weak.time * (1 - resistances.Weak);
         character.ani.Play("weak", 0, 0);
         character.ChangeState(CharacterState.SpecialStatus_Weak);
@@ -583,10 +583,10 @@ public class AttributeStatus : MonoBehaviour
     }
 
     //受到穿甲
-    public int AddArmorPiercing(AttackInfo attackInfo)
+    public int AddArmorPiercing(AttackController.AttackMethod attackMethod)
     {
-        this.attackInfo = attackInfo;
-        AttackInfo.ArmorPiercing armor = attackInfo.armorPiercing;
+        this.attackMethod = attackMethod;
+        AttackInfo.ArmorPiercing armor = attackMethod.attackInfo.armorPiercing;
         //计算护甲减免
         int am = resistances.armor;
         if (am > 0)
@@ -601,19 +601,19 @@ public class AttributeStatus : MonoBehaviour
     }
 
     //受到易伤
-    public void AddVulnerable(AttackInfo attackInfo)
+    public void AddVulnerable(AttackController.AttackMethod attackMethod)
     {
-        this.attackInfo = attackInfo;
-        AttackInfo.Vulnerable vulnerable = attackInfo.vulnerable;
+        this.attackMethod = attackMethod;
+        AttackInfo.Vulnerable vulnerable = attackMethod.attackInfo.vulnerable;
         vulnerableTime = vulnerable.time;
         haveVulnerable = true;
     }
 
     //受到累伤
-    public void AddStackingWouds(AttackInfo attackInfo)
+    public void AddStackingWouds(AttackController.AttackMethod attackMethod)
     {
-        this.attackInfo = attackInfo;
-        AttackInfo.StackingWounds stackingWounds = attackInfo.stackingWounds;
+        this.attackMethod = attackMethod;
+        AttackInfo.StackingWounds stackingWounds = attackMethod.attackInfo.stackingWounds;
         stackingWoudsTime = stackingWounds.time;
         stackingWordsNum++;
     }

+ 9 - 2
ActionTowerDefense/Assets/Scripts/Characters/BeHitTrigger.cs

@@ -40,9 +40,9 @@ public class BeHitTrigger : MonoBehaviour
         owner.BeHit(damage);
     }
 
-    public void BeHit(AttackInfo attackInfo, Character attackFrom)
+    public void BeHit(AttackController.AttackMethod attackMethod, Character attackFrom)
     {
-        owner.BeHit(attackInfo,attackFrom);
+        owner.BeHit(attackMethod,attackFrom);
         //Debug.Log(attackInfo.damage + "" + attackFrom.name);
     }
 
@@ -73,6 +73,13 @@ public class BeHitTrigger : MonoBehaviour
         mats = new List<Material>();
     }
 
+    private void OnDisable()
+    {
+        foreach (Material m in mats)
+        {
+            m.SetFloat("_FillPhase", 0);
+        }
+    }
     private void TurnOrigColor()
     {
         isWhite = true;

+ 1 - 1
ActionTowerDefense/Assets/Scripts/Characters/Character.cs

@@ -261,7 +261,7 @@ public class Character : MonoBehaviour
     }
 
     //Ôì³ÉÉ˺¦¸½¼ÓÆäËûЧ¹û
-    public virtual void BeHit(AttackInfo attackInfo, Character attackFrom, int damage = -1)
+    public virtual void BeHit(AttackController.AttackMethod attackMethod, Character attackFrom, int damage = -1)
     {
     }
 

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

@@ -640,6 +640,7 @@ public class Demonic : MoveCharacter
     {
         if (state == newState || newState == CharacterState.FramePause)
         {
+            state = newState;
             return;
         }
         switch (state)

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

@@ -545,6 +545,7 @@ public class Enemy : MoveCharacter
     {
         if (state == newState || newState == CharacterState.FramePause)
         {
+            state = newState;
             return;
         }
         switch (state)

+ 27 - 13
ActionTowerDefense/Assets/Scripts/Characters/HitFeedbackSystem.cs

@@ -10,12 +10,13 @@ public class HitFeedbackSystem : MonoBehaviour
     private AttributeStatus attributeStatus;
 
     [TabGroup("¶ÙÖ¡")] public int freezeFrame;
+    [TabGroup("¶ÙÖ¡")] public bool attackFromHasFreezeFrame;
     [TabGroup("¶ÙÖ¡")] [DisplayOnly] public bool isFreeze;
     [HideInInspector] public bool canFreeze;
     private RigidbodyConstraints origRC;
     private Vector3 velocity;   //¶Ù֡ǰËÙ¶È
-    [HideInInspector] public CharacterState curCharacterState;  //¶Ù֡ǰ״̬
-    [HideInInspector] public AttackInfo attackInfoData;
+    public CharacterState curCharacterState;  //¶Ù֡ǰ״̬
+    [HideInInspector] public AttackController.AttackMethod attackMethod;
     [HideInInspector] public Character attackFromData;
 
     [TabGroup("½©Ö±")] [DisplayOnly] public float hitStunTime;
@@ -50,13 +51,14 @@ public class HitFeedbackSystem : MonoBehaviour
             {
                 isFreeze = false;
                 character.ani.speed = 1;
-                if (character.rb.constraints == RigidbodyConstraints.FreezeAll)
+                character.rb.constraints = origRC;
+                character.rb.velocity = velocity;
+                character.ChangeState(curCharacterState);
+                if (attackFromData != null)
                 {
-                    character.rb.constraints = origRC;
-                    character.rb.velocity = velocity;
-                    character.ChangeState(curCharacterState);
+                    attributeStatus.AddSpecialState(attackMethod, attackFromData);
+                    attackFromData = null;
                 }
-                attributeStatus.AddSpecialState(attackInfoData, attackFromData);
             }
             freezeFrame -= 1;
         }
@@ -76,7 +78,7 @@ public class HitFeedbackSystem : MonoBehaviour
     }
 
     //¶ÙÖ¡
-    public void FreezeFrame(AttackInfo attackInfo, Character attackFrom)
+    public void FreezeFrame(AttackController.AttackMethod attackMethod, Character attackFrom)
     {
         if (canFreeze)
         {
@@ -84,23 +86,35 @@ public class HitFeedbackSystem : MonoBehaviour
             {
                 return;
             }
-            attackInfoData = attackInfo;
+            this.attackMethod = attackMethod;
             attackFromData = attackFrom;
             canFreeze = false;
             if (!isFreeze)
             {
+                HitFeedbackSystem hitFeedbackSystem = (attackFrom as MoveCharacter).hitFeedbackSystem;
                 origRC = character.rb.constraints;
                 velocity = character.rb.velocity;
                 curCharacterState = character.state;
+                character.ani.speed = 0;
+                character.rb.constraints = RigidbodyConstraints.FreezeAll;
                 character.ChangeState(CharacterState.FramePause);
+                isFreeze = true;
+                if (attackFromHasFreezeFrame && !hitFeedbackSystem.isFreeze)
+                {
+                    hitFeedbackSystem.freezeFrame = freezeFrame;
+                    hitFeedbackSystem.origRC = attackFrom.rb.constraints;
+                    hitFeedbackSystem.velocity = attackFrom.rb.velocity;
+                    hitFeedbackSystem.curCharacterState = attackFrom.state;
+                    attackFrom.ani.speed = 0;
+                    attackFrom.rb.constraints = RigidbodyConstraints.FreezeAll;
+                    attackFrom.ChangeState(CharacterState.FramePause);
+                    hitFeedbackSystem.isFreeze = true;
+                }
             }
-            isFreeze = true;
-            character.ani.speed = 0;
-            character.rb.constraints = RigidbodyConstraints.FreezeAll;
         }
         else
         {
-            attributeStatus.AddSpecialState(attackInfo,attackFrom);
+            attributeStatus.AddSpecialState(attackMethod,attackFrom);
         }
     }
 

+ 7 - 8
ActionTowerDefense/Assets/Scripts/Characters/MoveCharacter.cs

@@ -14,7 +14,6 @@ public class MoveCharacter : Character
 
     [FoldoutGroup("组件")] public Foot foot;
     [HideInInspector] public AttributeStatus attributeStatus;
-    private ScreenReflectPresets screenReflectPresets;
     [HideInInspector] public HitFeedbackSystem hitFeedbackSystem;
     [HideInInspector] public SpineEvent spineEvent;
 
@@ -93,7 +92,6 @@ public class MoveCharacter : Character
         mesh = spinee.GetComponent<MeshRenderer>();
         mats = mesh.materials;
         attributeStatus = GetComponentInChildren<AttributeStatus>();
-        screenReflectPresets = Camera.main.GetComponentInParent<ScreenReflectPresets>();
         hitFeedbackSystem = beHitTrigger.GetComponent<HitFeedbackSystem>();
     }
 
@@ -236,14 +234,15 @@ public class MoveCharacter : Character
 
     //造成伤害附加其他效果,最好都用这个新版本的
     //damage 有传参的话会忽略attackinfo 中的damage值
-    public override void BeHit(AttackInfo attackInfo, Character attackFrom, int damage = -1)
+    public override void BeHit(AttackController.AttackMethod attackMethod, Character attackFrom, int damage = -1)
     {
         if (invincibleTime > 0)
         {
             //attributeStatus.AddSpecialState(attackInfo, attackFrom);
             return;
         }
-        screenReflectPresets.ScreenReflect(hitFeedbackSystem, attackInfo.attackValue - hitResistance);
+        AttackInfo attackInfo = attackMethod.attackInfo;
+        ScreenReflectPresets.instance.ScreenReflect(hitFeedbackSystem, attackInfo.attackValue - hitResistance);
         int damageData;
         if(damage == -1)
         {
@@ -264,15 +263,15 @@ public class MoveCharacter : Character
                     /*非控制*/
                     //穿甲
                     case AttackEffect.ArmorPiercing:
-                        armorRate = attributeStatus.AddArmorPiercing(attackInfo);
+                        armorRate = attributeStatus.AddArmorPiercing(attackMethod);
                         break;
                     //易伤
                     case AttackEffect.Vulnerable:
-                        attributeStatus.AddVulnerable(attackInfo);
+                        attributeStatus.AddVulnerable(attackMethod);
                         break;
                     case AttackEffect.StackingWounds:
                         haveStackingWords = true;
-                        attributeStatus.AddStackingWouds(attackInfo);
+                        attributeStatus.AddStackingWouds(attackMethod);
                         break;
                 }
             }
@@ -354,7 +353,7 @@ public class MoveCharacter : Character
         //顿帧
         if(damage == -1)
         {
-            hitFeedbackSystem.FreezeFrame(attackInfo, attackFrom);
+            hitFeedbackSystem.FreezeFrame(attackMethod, attackFrom);
         }
         
     }

+ 6 - 5
ActionTowerDefense/Assets/Scripts/Characters/PlayerController.cs

@@ -1270,8 +1270,9 @@ public class PlayerController : MoveCharacter
 
     public override void ChangeState(CharacterState newState)
     {
-        if (state == newState)
+        if (state == newState || newState == CharacterState.FramePause)
         {
+            state = newState;
             return;
         }
         Vector3 velocity = rb.velocity;
@@ -1675,20 +1676,20 @@ public class PlayerController : MoveCharacter
         }
     }
 
-    public override void BeHit(AttackInfo attackInfo, Character attackFrom, int damage = -1)
+    public override void BeHit(AttackController.AttackMethod attackMethod, Character attackFrom, int damage = -1)
     {
-        if (conductController.HavePhoton(attackFrom, attackInfo.damage))
+        if (conductController.HavePhoton(attackFrom, attackMethod.attackInfo.damage))
         {
             return;
         }
-        base.BeHit(attackInfo, attackFrom);
+        base.BeHit(attackMethod, attackFrom);
         //ÆÁÄ»ºìÉÁ+¶¶¶¯
         if (ss == null)
         {
             ss = Camera.main.GetComponentInParent<ScreenShake>();
         }
         ss.enabled = true;
-        if (isSustainedInjury || attackInfo.damage >= heavyDamage)
+        if (isSustainedInjury || attackMethod.attackInfo.damage >= heavyDamage)
         {
             ss.ShakeScreen(1);
         }

+ 3 - 3
ActionTowerDefense/Assets/Scripts/Characters/Polliwog.cs

@@ -50,7 +50,7 @@ public class Polliwog : Enemy
         currentVelocity = Vector2.zero;
         SingleEnemyConfig cfgEnemy = GameManager.instance.allCfgData.CfgEnemy.Get("òòò½");
         moveSpeed =  Random.Range(cfgEnemy.MinMoveSpeed, cfgEnemy.MaxMoveSpeed);
-        attackController.curAttackMethod.attackTrigger.attackInfo.damage = cfgEnemy.AttackMarch[0];
+        attackController.curAttackMethod.attackTrigger.attackMethod.attackInfo.damage = cfgEnemy.AttackMarch[0];
         totalHp = cfgEnemy.HP;
         rotationSpeed = baseRotationSpeed + Random.Range(-rotationSpeedDeviation, rotationSpeedDeviation);
         ChangeState(CharacterState.Run);
@@ -62,9 +62,9 @@ public class Polliwog : Enemy
         base.BeHit(damage);
     }
 
-    public override void BeHit(AttackInfo attackInfo, Character attackFrom, int damage = -1)
+    public override void BeHit(AttackController.AttackMethod attackMethod, Character attackFrom, int damage = -1)
     {
-        base.BeHit(attackInfo, attackFrom, damage);
+        base.BeHit(attackMethod, attackFrom, damage);
     }
 
     public override void ChangeState(CharacterState newState)

+ 2 - 2
ActionTowerDefense/Assets/Scripts/Conduct/BigSoldier.cs

@@ -88,9 +88,9 @@ public class BigSoldier : Demonic
         }
     }
 
-    public override void BeHit(AttackInfo attackInfo, Character attackFrom, int damage = -1)
+    public override void BeHit(AttackController.AttackMethod attackMethod, Character attackFrom, int damage = -1)
     {
-        base.BeHit(attackInfo, attackFrom);
+        base.BeHit(attackMethod, attackFrom);
         if (hp <= nextRefHP && hp > 0)
         {
             TranSize_HP();

+ 5 - 5
ActionTowerDefense/Assets/Scripts/Conduct/MagicBullet.cs

@@ -20,7 +20,7 @@ public class MagicBullet : Bullet
         dis2.z = dis1.z;
         if (Vector3.Distance(dis1, dis2) < 0.1)
         {
-            trackTarget.GetComponentInChildren<BeHitTrigger>().BeHit(attackInfo, owner);
+            trackTarget.GetComponentInChildren<BeHitTrigger>().BeHit(attackMethod, owner);
             gameObject.SetActive(false);
         }
     }
@@ -35,9 +35,9 @@ public class MagicBullet : Bullet
         gameObject.SetActive(true);
         isGetTarget = false;
         flyTime = 0;
-        attackInfo = new AttackInfo
-        {
-            damage = damage
-        };
+        //attackMethod = new AttackController.AttackMethod
+        //{
+        //    attackInfo.damage = damage
+        //};
     }
 }

+ 1 - 1
ActionTowerDefense/Assets/Scripts/Spirits/ESpirits_Assassin.cs

@@ -43,7 +43,7 @@ public class ESpirits_Assassin : Enemy
     {
         base.Start();
         len = 1;
-        dashTrigger.attackInfo.damage = attackController.attackMethod_summon[0].attackInfo.damage;
+        dashTrigger.attackMethod.attackInfo.damage = attackController.attackMethod_summon[0].attackInfo.damage;
     }
 
     public override void Init()

+ 21 - 21
ActionTowerDefense/Assets/Scripts/Spirits/FloatEffect.cs

@@ -22,27 +22,27 @@ public class FloatEffect : MonoBehaviour
         GetComponent<Collider>().enabled = false;
     }
 
-    private void OnTriggerEnter(Collider other)
-    {
-        if (other.gameObject.layer == 8 )
-        {
-            AttributeStatus attributeStatus = other.GetComponent<AttributeStatus>();
-            attributeStatus.AddFloat(attackInfo);
-        }
-        else if(isEnemy && other.gameObject.layer == 7)
-        {
-            AttributeStatus attributeStatus = other.GetComponent<AttributeStatus>();
-            attributeStatus.AddFloat(attackInfo);
-        }
-        if(isEnemy && other.gameObject.layer == 6)
-        {
-            PlayerController pc = other.GetComponent<PlayerController>();
-            pc.lostMp = 0;
-            pc.soulCollector.enabled = false;
-            AttributeStatus attributeStatus = other.GetComponent<AttributeStatus>();
-            attributeStatus.AddFloat(attackInfo);
-        }
-    }
+    //private void OnTriggerEnter(Collider other)
+    //{
+    //    if (other.gameObject.layer == 8 )
+    //    {
+    //        AttributeStatus attributeStatus = other.GetComponent<AttributeStatus>();
+    //        attributeStatus.AddFloat(attackInfo);
+    //    }
+    //    else if(isEnemy && other.gameObject.layer == 7)
+    //    {
+    //        AttributeStatus attributeStatus = other.GetComponent<AttributeStatus>();
+    //        attributeStatus.AddFloat(attackInfo);
+    //    }
+    //    if(isEnemy && other.gameObject.layer == 6)
+    //    {
+    //        PlayerController pc = other.GetComponent<PlayerController>();
+    //        pc.lostMp = 0;
+    //        pc.soulCollector.enabled = false;
+    //        AttributeStatus attributeStatus = other.GetComponent<AttributeStatus>();
+    //        attributeStatus.AddFloat(attackInfo);
+    //    }
+    //}
 
     private void Update()
     {

+ 13 - 4
ActionTowerDefense/Assets/Scripts/SystemReflect/ScreenReflectPresets.cs

@@ -4,13 +4,15 @@ using UnityEngine;
 
 public enum ScreenReflectEffects
 {
-    screenShake = 0,        //屏幕震动
-    freezeFrame = 1,        //顿帧
-    hitStun = 2,            //硬直
+    [LabelText("屏幕震动")] screenShake = 0,        
+    [LabelText("顿帧")] freezeFrame = 1,          
+    [LabelText("僵直")] hitStun = 2,        
+    
 }
 
-public class ScreenReflectPresets : MonoBehaviour
+public class ScreenReflectPresets:MonoBehaviour
 {
+    static public ScreenReflectPresets instance;
     [System.Serializable]
     public struct ScreenReflects
     {
@@ -19,6 +21,8 @@ public class ScreenReflectPresets : MonoBehaviour
         public int level;
         [ShowIf("effect", ScreenReflectEffects.freezeFrame)]
         public int frame;
+        [ShowIf("effect", ScreenReflectEffects.freezeFrame)]
+        [LabelText("攻击方是否也会顿帧")] public bool attackFromHasFreezeFrame;
         [ShowIf("effect", ScreenReflectEffects.hitStun)]
         public float time;
     }
@@ -37,6 +41,10 @@ public class ScreenReflectPresets : MonoBehaviour
 
     void Awake()
     {
+        if (!instance)
+        {
+            instance = this;
+        }
         Application.targetFrameRate = 120;   //锁定最大帧率为120帧
     }
 
@@ -55,6 +63,7 @@ public class ScreenReflectPresets : MonoBehaviour
                             break;
                         case ScreenReflectEffects.freezeFrame:
                             hfs.freezeFrame = sr.frame;
+                            hfs.attackFromHasFreezeFrame = sr.attackFromHasFreezeFrame;
                             hfs.canFreeze = true;
                             break;
                         case ScreenReflectEffects.hitStun:

+ 2 - 2
ActionTowerDefense/Assets/Scripts/Tower/EnemyTower.cs

@@ -127,8 +127,8 @@ public class EnemyTower : Character
         base.BeHit(damage);
     }
 
-    public override void BeHit(AttackInfo attackInfo, Character attackFrom, int damage = -1)
+    public override void BeHit(AttackController.AttackMethod attackMethod, Character attackFrom, int damage = -1)
     {
-        base.BeHit(attackInfo.damage);
+        base.BeHit(attackMethod.attackInfo.damage);
     }
 }

+ 2 - 2
ActionTowerDefense/Assets/Scripts/Tower/Tower.cs

@@ -128,8 +128,8 @@ public class Tower : Character
         base.BeHit(damage);
     }
 
-    public override void BeHit(AttackInfo attackInfo, Character attackFrom, int damage = -1)
+    public override void BeHit(AttackController.AttackMethod attackMethod, Character attackFrom, int damage = -1)
     {
-        base.BeHit(attackInfo.damage);
+        base.BeHit(attackMethod.attackInfo.damage);
     }
 }