示例#1
0
 public void PlayerScored()
 {
     score++;
     uiController.UpdateScoreText(score);
     uiController.Celebrate();
     KyVibrator.Vibrate(40);
     if (poopsLeft < poopsMax)
     {
         poopsLeft++;
     }
 }
示例#2
0
    private void PlayerHit()
    {
        if (!_isDead)
        {
            GameObject explode = Instantiate(dieParticle, _playerTransform.position, Quaternion.identity);
            Destroy(explode, 0.2f);

            _isDead = true;
            LivesManager.RemoveALife();
            //explode particle
            Destroy(gameObject);

#if !UNITY_EDITOR
            KyVibrator.Vibrate(5);
#endif
        }
    }
示例#3
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("Enemy"))
        {
            if (other.gameObject != null)
            {
                enemyManager = other.gameObject.GetComponentInParent <EnemyManager>();
                enemyManager.RespawnEnemy();
                GameObject obj = Instantiate(ExplosionParticle, transform.position, Quaternion.identity);
                Destroy(obj, 0.2f);

#if !UNITY_EDITOR
                KyVibrator.Vibrate(1);
#endif
                Destroy(other.gameObject);
                Score.AddScore();
            }
            Destroy(gameObject);
        }
    }