diff --git a/Role/Attack.cs b/Role/Attack.cs index c7d1ef8..831ef17 100644 --- a/Role/Attack.cs +++ b/Role/Attack.cs @@ -18,7 +18,7 @@ public class Attack : MonoBehaviour [Header("攻击CD时间")] public float attackCooldown = 1f; // 攻击冷却时间 private float lastAttackTime = 0f; // 上次攻击的时间 - + [HideInInspector] public List bulltes = new List(); diff --git a/Role/Fun.cs b/Role/Fun.cs index c11f382..59bfbe4 100644 --- a/Role/Fun.cs +++ b/Role/Fun.cs @@ -82,6 +82,11 @@ public class Fun : Base } targetAudience.Hp -= finalDamage; + if (targetAudience.Hp<=0) + { + UserObj.killNum++; + Debug.Log(UserObj.name+"ɱ"+ UserObj.killNum); + } targetAudience.HurtDirectin = direction; } diff --git a/Role/Role.cs b/Role/Role.cs index 4a73339..db9216c 100644 --- a/Role/Role.cs +++ b/Role/Role.cs @@ -75,7 +75,7 @@ public class Role : Fun public float AttackCD;//CD public float CritRate;// public float CriticalHitRateBonus;//ӳ - + [Header("ɱ")] public int killNum; public float Hp { @@ -160,7 +160,7 @@ public class Role : Fun public event AnimationItem OnAnimationIng; public event AnimationItem OnAnimationEnd; [Header("Ƿ")] public bool isAnimationPlay = false;//Ƿ - [Header("ײ")]public CircleCollider2D mycollider; + [Header("ײ")]public Collider2D mycollider; [Header("ű")] public Attack attackClass; [Header("ǰͼƬ")] public int CurrentIndex; @@ -314,6 +314,7 @@ public class Role : Fun { animationHighlight = dieIndex; Navigation.PauseAnimation(); + mycollider.enabled = false; Debug.Log("die"); }