private void AddSheetOnSheetCollision(BonusSheet bonusSheet) { bonusSheets.Remove(bonusSheet); var reward = rewardService.GetBonusReward(RewardType.Sheet); statisticService.AddSheet(reward); }
private void OnTriggerEnter2D(Collider2D other) { var collidedGameObject = other.gameObject; if (!collidedGameObject.CompareTag(Tags.ENEMY_HEART_TAG)) { return; } var enemyObject = collidedGameObject.GetComponentInParent <EnemyBehaviour>(); var rewardType = enemyObject.RewardType; enemyObject.OnEnemyDestroyed += () => { var reward = rewardService.GetBonusReward(rewardType); statisticService.AddKill(reward); particleService.InitializeParticle(rewardType, enemyObject.transform.position); }; enemyObject.DestroyEnemy(); parentRigidbody2D.velocity = transform.up * bounceForce; }