Death added

This commit is contained in:
2022-02-26 18:31:19 +03:00
parent 3ccc7a24b8
commit 5b9d219464
7 changed files with 283 additions and 8 deletions

View File

@@ -6,7 +6,6 @@ namespace AI
[RequireComponent(typeof(Rigidbody2D))]
public class Projectile : MonoBehaviour, IPausable
{
[SerializeField] protected float damageOnContact = 50f;
private Rigidbody2D _rigidbody = null;
private void Awake()
@@ -22,6 +21,9 @@ namespace AI
private void OnCollisionEnter2D(Collision2D other)
{
ProjectilePool.Instance.Return(this);
if (other.transform.CompareTag("Player"))
other.gameObject.GetComponent<Player.Death>().Die();
}
public bool IsPaused { get; protected set; } = false;