virtual public void Update() { if (curTarget != null) { if (reloadTimer > 0) { reloadTimer -= Time.deltaTime; } if (reloadTimer < 0) { reloadTimer = 0; } if (reloadTimer == 0) { Virus vrs = curTarget.GetComponent <Virus>(); //float distance = Vector3.Distance(turretHead.position, curTarget.transform.position); if (vrs != null) { vrs.ChangeHP(attackDamage); } reloadTimer = reloadCooldown; } } else { curTarget = SortTargets(); } }