Пуля теперь может врезаться в другую башню

This commit is contained in:
2026-06-07 02:44:02 +03:00
parent 6131e20242
commit 06ba27da72
2 changed files with 8 additions and 0 deletions
+2
View File
@@ -8,6 +8,7 @@ public class TurretBullet : MonoBehaviour
private Vector3 _spawnPos;
public Turret From { get; private set; }
public float Damage => _damage;
public float Distance => _distance;
@@ -28,6 +29,7 @@ public class TurretBullet : MonoBehaviour
var rot = turret.transform.rotation;
rot.SetLookRotation(direction);
var bullet = Instantiate(this, spawnPoint, rot, turret.transform);
bullet.From = turret;
bullet._damage += turret.Damage;
bullet._distance += turret.Distance - Vector3.Distance(spawnPoint, bullet.transform.position);