From 9abbdf408daf5bc140ffd039125f6ac54f2774b9 Mon Sep 17 00:00:00 2001 From: wangguan <wangguan@kt007.com> Date: Fri, 06 Nov 2020 10:13:55 +0800 Subject: [PATCH] Merge branch 'master' of ssh://172.16.1.52:8091/GemBattle --- Assets/Scripts/ActionGameFramework/Health/DamageCollider.cs | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/Assets/Scripts/ActionGameFramework/Health/DamageCollider.cs b/Assets/Scripts/ActionGameFramework/Health/DamageCollider.cs index 5b1ed7a..c7a200b 100644 --- a/Assets/Scripts/ActionGameFramework/Health/DamageCollider.cs +++ b/Assets/Scripts/ActionGameFramework/Health/DamageCollider.cs @@ -54,6 +54,16 @@ var agent = this.gameObject.GetComponent<Agent>(); if (agent == null) return; + + BallisticProjectile ballistic = c.gameObject.GetComponent<BallisticProjectile>(); + + if (ballistic.IsHitEnemy) + { + Debug.LogError("--------------------- 已发生过碰撞 ---------------------"); + return; + } + + ballistic.IsHitEnemy = true; LazyLoad(); -- Gitblit v1.9.1