using NUnit.Framework; using System.Collections.Generic; using UnityEngine; using UnityEngine.InputSystem; public class PlayerInput : MonoBehaviour { // Start is called once before the first execution of Update after the MonoBehaviour is created public List bullets = new List(); // Update is called once per frame void Update() { bullets.RemoveAll(b => b == null); if (!Pointer.current.press.wasPressedThisFrame) return; bool nearMissThisTap = false; if (NearMissManager.bulletInZone) { VFXManager.Instance.SlowMo(0.2f, 0.8f); VFXManager.Instance.ScreenShake(0.1f, 0.1f); } foreach (GameObject bulletObj in bullets) { if (bulletObj == null) continue; Bullet bullet = bulletObj.GetComponent(); if (bullet == null) continue; // 🎯 reverse logic (always per bullet) if (bullet.bulletState == BulletStates.inPointZone || bullet.bulletState == BulletStates.inNearMissZone) { bullet.Reverse(); } // 🔥 near miss logic (still per bullet) if (bullet.bulletState == BulletStates.inNearMissZone) { bullet.bulletState = BulletStates.markForDeletion; nearMissThisTap = true; // accumulate result } } // ⭐ FINAL RESULT (once per tap) ScoreManager.Instance.NearMissMultiplierManager(nearMissThisTap); } public bool nearMissPlayerManager(Bullet bullet) { if (bullet.bulletState == BulletStates.inNearMissZone) { return true; } return false; } }