Death added
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user