private void TriggerCollisionWithObstacle(Collider2D collision) { ObjectPoolEvents.OnSpawnParticle(transform.position); HUDEvents.OnApplyNewScore(transform.position); ObjectPoolEvents.OnReturnObstacleToPool(collision.gameObject); ObjectPoolEvents.OnReturnBulletToPool(gameObject); }
private void ReactOnTriggerCollision(Collider2D collision) { if (collision.CompareTag(BulletTag)) { ObjectPoolEvents.OnReturnBulletToPool(collision.gameObject); } if (collision.CompareTag(ObstacleTag)) { ObjectPoolEvents.OnReturnObstacleToPool(collision.gameObject); } }