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);
        }
    }
Beispiel #3
0
 private void TriggerCollisionWithObstacle(Collider2D collision)
 {
     DecreaseHealthCount();
     ObjectPoolEvents.OnReturnObstacleToPool(collision.gameObject);
 }
 private void OnDisable()
 {
     ObjectPoolEvents.OnReturnParticle(this.gameObject);
 }