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;