private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.TryGetComponent <Player>(out Player player)) { Debug.Log("Heart someone"); PlayerProjectilePool.ReturnProjectile(gameObject); } StopMoving(); anim.SetBool("PlayerProjectileExplosion", true); }
private void OnBecameInvisible() { PlayerProjectilePool.ReturnProjectile(gameObject); }