public void PlayerScored() { score++; uiController.UpdateScoreText(score); uiController.Celebrate(); KyVibrator.Vibrate(40); if (poopsLeft < poopsMax) { poopsLeft++; } }
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 } }
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); } }