diff --git a/Assets/Scripts/Enemy/EnemyHealth.cs b/Assets/Scripts/Enemy/EnemyHealth.cs index 734d9ab6997109b3b1c4bcd7604fa5c714113d65..726b12e915eb9e2369a4cef891290a05741e783e 100644 --- a/Assets/Scripts/Enemy/EnemyHealth.cs +++ b/Assets/Scripts/Enemy/EnemyHealth.cs @@ -20,8 +20,6 @@ namespace Nightmare CapsuleCollider capsuleCollider; EnemyMovement enemyMovement; - bool isPet; - // Orbs public GameObject increaseDamageOrbPrefab; // Increase Damage Orb public GameObject restoreHealthOrbPrefab; // Restore Health Orb @@ -29,8 +27,6 @@ namespace Nightmare void Awake () { - isPet = GetComponent<EnemyPetMovement>() != null; - if (isPet) { Debug.Log("Dogs");} anim = GetComponent <Animator> (); enemyAudio = GetComponent <AudioSource> (); hitParticles = GetComponentInChildren <ParticleSystem> (); @@ -65,11 +61,6 @@ namespace Nightmare { if (IsDead()) { - if (isPet) - { - // TODO: Set rigidbody to kinematic and sink instead of vanish immediately - Destroy(gameObject); - }; transform.Translate (-Vector3.up * sinkSpeed * Time.deltaTime); if (transform.position.y < -10f) { @@ -85,12 +76,10 @@ namespace Nightmare public void TakeDamage (int amount, Vector3 hitPoint) { - if (isPet) Debug.Log("kaing"); if (!IsDead()) { - if (!isPet) enemyAudio.Play(); + // if (!isPet) enemyAudio.Play(); currentHealth -= amount; - if (isPet) Debug.Log("Dog health : " + currentHealth ); if (currentHealth <= 0) { diff --git a/Assets/Scripts/Pets/EnemyPetHealth.cs b/Assets/Scripts/Pets/EnemyPetHealth.cs index 01713b925ab64f0eec332a23fc59871330291a6b..df3032e38892b43ac4f02f238be5f0107118e2ec 100644 --- a/Assets/Scripts/Pets/EnemyPetHealth.cs +++ b/Assets/Scripts/Pets/EnemyPetHealth.cs @@ -40,11 +40,13 @@ namespace Nightmare { if (IsDead()) { - transform.Translate (-Vector3.up * sinkSpeed * Time.deltaTime); - if (transform.position.y < -10f) - { - Destroy(gameObject); - } + // TODO: Set rigidbody to kinematic and sink instead of vanish immediately + Destroy(gameObject); + // transform.Translate (-Vector3.up * sinkSpeed * Time.deltaTime); + // if (transform.position.y < -1f) + // { + // Destroy(gameObject); + // } } } @@ -55,7 +57,7 @@ namespace Nightmare public void TakeDamage (int amount, Vector3 hitPoint) { - + Debug.Log("Enemy Pet: " + currentHealth); if (!IsDead()) { // enemyAudio.Play();