public void InflictDamage(GameObject source, float amount) { if (_invincible) { return; } currentHealth -= amount; for (int i = 0; i < amount; i++) { heartMeter.RemoveHalfHeart(); } Vector3 bloodPos = transform.position; TheBloodenerScript.MakeBlood(bloodPos); if (currentHealth <= 0) { Kill(); } else { _playerMover.DamageKnockBack(source); Invincible(invincibleTime); } }
public void Kill() { Vector3 bloodPos = transform.position; TheBloodenerScript.MakeBlood(bloodPos); TheBloodenerScript.MakeBlood(bloodPos); TheBloodenerScript.MakeBlood(bloodPos); currentHealth = 0; heartMeter.RemoveAllHearts(); DeactivatePlayer(); }
public override void Kill() { _collider.enabled = false; Vector3 bloodPos = transform.position; bloodPos.y -= 0.3f; TheBloodenerScript.MakeBlood(bloodPos); TheBloodenerScript.MakeBlood(bloodPos); TheBloodenerScript.MakeBlood(bloodPos); Destroy(gameObject); }
public override void InflictDamage(float value) { currentHealth -= value; Vector3 bloodPos = transform.position; bloodPos.y -= 0.3f; TheBloodenerScript.MakeBlood(bloodPos); if (currentHealth <= 0) { Kill(); } }
void Start() { bloodPool = new List <GameObject>(); GameObject bloodPoolObject = new GameObject(); bloodPoolObject.transform.name = "BloodPool"; for (int i = 0; i < poolSize; i++) { GameObject newBlood = (GameObject)Instantiate(bloodPrefab); newBlood.transform.name = bloodPrefab.transform.name; newBlood.transform.parent = bloodPoolObject.transform; bloodPool.Add(newBlood); } if (isSingletonInstance) { TheBloodenerScript.singletonInstance = this; } }