private void ProcessHit(DamageDealer damageDealer) { _health -= damageDealer.GetDamage(); SetValue.Score += _scoreValue; CanvasManager.UpdateScoreUI(); damageDealer.Hit(); if (_health <= 0) { Die(); } }
private void ProcessHit(DamageDealer damageDealer) { health -= damageDealer.GetDamage(); damageDealer.Hit(); if (health > 0) { StartCoroutine("SwitchColor"); } if (health <= 0) { health = 0f; Die(); } }
private void ProcessHit(DamageDealer damageDealer) { health -= damageDealer.Damage; if (health <= 0) { AudioSource.PlayClipAtPoint(deathSound, Camera.main.transform.position, soundLevel); var explosionObj = Instantiate(explosion.gameObject, transform.position, Quaternion.identity); Destroy(explosionObj, 1f); Destroy(gameObject); FindObjectOfType <SceneLoader>().LoadGameOver(); } damageDealer.Hit(); }
private void ProcessHit(GameObject other) { DamageDealer damageDealer = other.gameObject.GetComponent <DamageDealer>(); if (damageDealer != null) { health -= damageDealer.GetDamage(); damageDealer.Hit(); } if (health <= 0) { Destroy(gameObject); } }
private void ProcessHit(DamageDealer damageDealer) { if (damageDealer == null) { return; } _health -= damageDealer.Damage; damageDealer.Hit(); if (_health <= 0) { Die(); AddToScore(); } }
private void OnTriggerEnter2D(Collider2D collision) { DamageDealer damageDealer = collision.GetComponent <DamageDealer>(); if (damageDealer) { damageDealer.Hit(); health -= damageDealer.GetDamage(); if (health <= 0) { Die(); } } }
private void OnTriggerEnter(Collider other) { if (other.tag == "Enemy") { DamageDealer damageDealer = other.gameObject.GetComponent <DamageDealer>(); if (!damageDealer) { return; } playerHealth -= damageDealer.GetDamage(); damageDealer.Hit(); ProcessHit(damageDealer); } }
public void ProcessHit(DamageDealer damageDealer) { health -= damageDealer.GetDamage(); health = Mathf.Clamp(health, 0, startHealth); damageDealer.Hit(); player.PlayerHitSfx(); player.HitVfx(); if (health <= 0f) { player.PlayerExplosionSFX(); player.PlayerExplosionVFX(); sceneLoader.LoadGameOverScene(); } }
void ProcessHit(DamageDealer damageDealer, bool isBoss) { health -= damageDealer.GetDamage(); if (!isBoss) { damageDealer.Hit(); } if (health <= 0) { FindObjectOfType <Level>().LoadGameOver(); AudioSource.PlayClipAtPoint(playerDieSound, Camera.main.transform.position, playerDieVolume); Destroy(gameObject); } }
/// <summary> /// Process hits by projectiles /// </summary> /// <param name="damageDealer"></param> private void ProcessHit(DamageDealer damageDealer) { // Minus health by the amound specified in the damage dealer class health -= damageDealer.GetDamage(); // Call damage dealer hit method damageDealer.Hit(); // If the enemy health reaches zero if (health <= 0) { Die(); } }
private void OnTriggerEnter2D(Collider2D collision) { DamageDealer damageDealer = collision.gameObject.GetComponent <DamageDealer>(); if (damageDealer) { health = Mathf.Max(health - damageDealer.GetDamage(), 0); // Avoid negative score damageDealer.Hit(); if (health <= 0) { Die(); } } }
private void ProcessHit(DamageDealer damageDealer) { health -= damageDealer.GetDamage(); damageDealer.Hit(); if (health <= 0) { Die(); } else { StartCoroutine(ColorFlash()); } }
private void OnBulletCollision(DamageDealer damageDealer) { if (!damageDealer) { return; } health -= damageDealer.GetDamage(); damageDealer.Hit(); if (health <= 0) { Destroy(gameObject); } }
private void ProcessHit(DamageDealer damageDealer) { if (damageDealer != null) { health -= damageDealer.GetDamage(); audioSource.PlayOneShot(hitSound, hitVolume); damageDealer.Hit(); } if (health <= 0) { Die(); } }
private void ProcessHit(DamageDealer damageDealer, Transform hitPosition) { LaserHitVFX(hitPosition); damageDealer.Hit(); // detsroy laser beam health -= damageDealer.GetDamage(); if (health <= 0) { _gameSession.IncreaseScore(killPoints); Destroy(gameObject); EnemyDestroyVFX(); } }
private void processHit(DamageDealer d) { //Gets how much damage the collision is doing enemyHealth -= d.getDamage(); SoundScript.PlaySound("enemy_hurt"); d.Hit(); if (enemyHealth <= 0) { Destroy(transform.parent.gameObject); SoundScript.PlaySound("enemy_explode"); FindObjectOfType <GameSession>().AddToScore(scoreValue); } StartCoroutine(flash()); }
private void ProcessHit(DamageDealer damageDealer) { health -= damageDealer.Damage; damageDealer.Hit(); if (health <= 0) { Destroy(gameObject); FindObjectOfType <GameSession>().AddToScore(scoreValue); AudioSource.PlayClipAtPoint(enemyKilledSfx, Camera.main.transform.position, enemyKilledVolume); var explosion = Instantiate(explosionParticle, transform.position, Quaternion.identity); Destroy(explosion, durationOfExplosion); ShowDamage(); } }
private void ProcessHit(DamageDealer damageDealer) { health -= damageDealer.GetDamage(); damageDealer.Hit(); spriteRenderer.color = new Color(255f, 0f, 0f); if (health <= 0) { Die(); } else { Invoke("ResetColor", .1f); } }
private void ProcessHit(DamageDealer damageDealer) { //Debug.Log("From Damage dealer : " + damageDealer.GetDamage()); health -= damageDealer.GetDamage(); // destroy the gameobject that the damagedealer object is attached to Debug.Log("Health : " + health); // in this case the enemy laser damageDealer.Hit(); if (health <= 0) { Die(); } }
private void ProcessHit(DamageDealer _damageDealer) { if (this.gameObject.tag == "bigboy") { BigBoyAnim _damageAnim = GetComponent <BigBoyAnim>(); _damageAnim.DamageAnim(); } _health -= _damageDealer.GetDamage(); _damageDealer.Hit(); if (_health <= 0) { Die(); } }
private void ProcessHit(DamageDealer damageDealer) { health -= damageDealer.GetDamage(); if (health <= 0) { health = 0; } damageDealer.Hit(); if (health <= 0) { Die(); } }
private void ProcessHit(DamageDealer damageDealer) { health -= damageDealer.GetDamage(); damageDealer.Hit(); if (health <= 0) { health = 0; Die(); } else { AudioSource.PlayClipAtPoint(hitSound, Camera.main.transform.position, hitSoundVolume); } }
private void ProcessHit(DamageDealer damageDealer) { health -= damageDealer.GetDamage(); if (damageDealer.tag != "Ground") { damageDealer.Hit(); } if (health <= 0) { Die(); } }
//dictates what happens when player gets hit private void ProcessHit(DamageDealer damageDealer) { health -= damageDealer.GetDamage(); damageDealer.Hit(); if (health <= 0) { Die(); level.LoadGameOver(); } else { StartCoroutine(Flicker()); } }
private void ProcessHit(DamageDealer damageDealer) { health -= damageDealer.getDamage(); damageDealer.Hit(); if (health <= 0) { Die(); } else { GameObject effect = Instantiate(onHitVFX, transform.position, Quaternion.identity); Destroy(effect, 1f); } }
private void ProcessHit(DamageDealer damageDealer) { hp -= damageDealer.GetDamage(); damageDealer.Hit(); AudioSource.PlayClipAtPoint(hitSFX, Camera.main.transform.position, hitVolume); if (hp <= 0) { Destroy(gameObject); GameObject explosion = Instantiate(deathVFX, transform.position, transform.rotation); Destroy(explosion, explosionDuration); AudioSource.PlayClipAtPoint(deathSFX, Camera.main.transform.position, dsVolume); FindObjectOfType <LevelLoad>().LoadGameOver(); } }
private void ProcessHit(DamageDealer damageDealer) { health -= damageDealer.GetDamage(); damageDealer.Hit(); if (boss) { boss.UpdateHealthbar(health); } if (health <= 0) { Die(); SpawnPickup(); } }
private void ProcessHit(DamageDealer damageDealer) { SetValue.PlayerHealth -= damageDealer.GetDamage(); CanvasManager.UpdateHealthUI(); damageDealer.Hit(); if (SetValue.PlayerHealth <= 0) { AudioSource.PlayClipAtPoint(_deathClip, Camera.main.transform.position, _deathVolume); Invoke("GameOverDelay", _gameOverDelay); gameObject.SetActive(false); } }
private void OnCollisionEnter2D(Collision2D collision) { DamageDealer dd = collision.gameObject.GetComponent <DamageDealer>(); hp -= dd.GetDamage(); if (hp <= 0) { Destroy(gameObject); AudioSource.PlayClipAtPoint(deathSound, Camera.main.transform.position, 0.75f); FindObjectOfType <SceneLoader>().GetComponent <SceneLoader>().GoLastScene(); } dd.Hit(); space.GetHP(dd.GetDamage()); }
private void ProcessDamage(DamageDealer damageDealer) { if (damageDealer == null) { return; } health -= damageDealer.GetDamage(); damageDealer.Hit(); if (health <= 0) { Die(); } }