From c8178b2b595b9f2be74d2f736b6a1b552ef81e02 Mon Sep 17 00:00:00 2001 From: GL <2365963573@qq.com> Date: Thu, 9 Jan 2025 10:35:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=BB=E5=87=BB=E8=8C=83=E5=9B=B4=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Role/Attack.cs | 4 ++-- Role/Bullet.cs | 2 +- Role/Role.cs | 3 +++ Role/SmallBullet.cs | 10 ++++++++-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Role/Attack.cs b/Role/Attack.cs index 167d7a2..0aa0d34 100644 --- a/Role/Attack.cs +++ b/Role/Attack.cs @@ -323,13 +323,13 @@ public class Attack : MonoBehaviour if (attackCollider&& role.AttackRange !=0) { // 设置碰撞体的半径 - attackCollider.radius = role.AttackRange-1; + attackCollider.radius = role.AttackRange+2f; // 计算缩放因子,使得图片的直径与碰撞体的直径匹配 - characterClick.OrSizeX = (role.AttackRange-1) * 2f / characterClick.StartSizeX; // * 2f 因为 radius 是半径,图片的尺寸通常是直径 + characterClick.OrSizeX = (role.AttackRange+2f) * 2f / characterClick.StartSizeX; // * 2f 因为 radius 是半径,图片的尺寸通常是直径 characterClick.OrSizeY = characterClick.OrSizeX; diff --git a/Role/Bullet.cs b/Role/Bullet.cs index 2e70920..aa4e279 100644 --- a/Role/Bullet.cs +++ b/Role/Bullet.cs @@ -86,7 +86,7 @@ public class Bullet : MonoBehaviour [Header("ӵƶ")] public bool IsMove = true; [Header("ӵײ")] public CircleCollider2D Collider2D; [Header("ӵЧԤ")] public List effectPres = new List(); - private float timer = 0; + public float timer = 0; [Header("ӵ")] public int NumberOfBulletAttacks = 1; [Header("Ŀ")] public GameObject Target; [Header("ӵǷĿ")] public bool noLockEnemy=false; diff --git a/Role/Role.cs b/Role/Role.cs index af64817..ecdfb5a 100644 --- a/Role/Role.cs +++ b/Role/Role.cs @@ -324,8 +324,11 @@ public class Role : Fun if (lsanimationHighlight == dieIndex) { //SpawnPool.intance.DeadNumber += 1; + + SpawnMonster.intance.enemysList.Remove(this.gameObject); + if (SpawnMonster.intance.enemysList.Count<=0) { SpawnMonster.intance.Index += 1; diff --git a/Role/SmallBullet.cs b/Role/SmallBullet.cs index 505be78..3e2e980 100644 --- a/Role/SmallBullet.cs +++ b/Role/SmallBullet.cs @@ -25,10 +25,16 @@ public class SmallBullet : Bullet this.gameObject.transform.Translate(Vector3.up * Time.deltaTime * bulletData.BulletSpeed*8); - - + timer += Time.deltaTime; + if (timer > BulletDeadTimer) + { + attackObj.bulltes.Remove(this.gameObject); + Debug.Log("ѳɹƳǰб" + attackObj.bulltes.Count); + Destroy(this.gameObject); + } + } break;