예제 #1
0
        private void AddSheetOnSheetCollision(BonusSheet bonusSheet)
        {
            bonusSheets.Remove(bonusSheet);
            var reward = rewardService.GetBonusReward(RewardType.Sheet);

            statisticService.AddSheet(reward);
        }
예제 #2
0
        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;
        }