From f3cad5d509e03c353dd16bfc5e599f39105deb26 Mon Sep 17 00:00:00 2001 From: GL <2365963573@qq.com> Date: Wed, 18 Dec 2024 14:16:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Role/Attack.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Role/Attack.cs b/Role/Attack.cs index eb8f798..62058fd 100644 --- a/Role/Attack.cs +++ b/Role/Attack.cs @@ -14,7 +14,7 @@ public class Attack : MonoBehaviour [Header("攻击范围")] public float attackScope; [Header("攻击类型")] public DamageType damageTyp = DamageType.noAttributeDamage; - [Header("攻击持续时间")] public float attackCooldown = 1f; // 攻击冷却时间 + [Header("攻击CD时间")] public float attackCooldown = 1f; // 攻击冷却时间 private float lastAttackTime = 0f; // 上次攻击的时间 [HideInInspector] @@ -66,7 +66,7 @@ public class Attack : MonoBehaviour { if (bulletPrefab.GetComponent().myBulletType != BulletType.Spraying) { - direction = (targetRole.transform.position - transform.position).normalized; + direction = (targetRole.transform.position - BulletStartPos.position).normalized; } animator.SetInteger("State", 1); lastAttackTime = Time.time; // 更新上次攻击时间 @@ -164,7 +164,7 @@ public class Attack : MonoBehaviour BulletGamobj.GetComponent().role = role; BulletGamobj.GetComponent().attackObj = this; BulletGamobj.transform.up = direction; - BulletGamobj.transform.position = transform.position; + BulletGamobj.transform.position = BulletStartPos.position; bulltes.Add(BulletGamobj); }