// Use this for initialization private void Start() { HealthBarUtils.SetMaxPlayerHealth(maxPlayerHealth); float playerMaxHealth = HealthBarUtils.GetMaxHealth(); witchBossBlackHoleDamage = playerMaxHealth; boyBossBurpDamage = playerMaxHealth; myBody.freezeRotation = true; }
private void PlayerDied() { if (HealthBarUtils.GetCurrentHealthBarValue() <= 0) { anim.SetBool(santaDyingAnimName, true); timeLeftUntilDeath -= Time.deltaTime; if (timeLeftUntilDeath < 0) { Time.timeScale = 0.0f; alive = false; } } }
private void DecreaseHealth(Collider2D other) { string bulletType = other.gameObject.name as string; // sanitize bullet names bulletType = bulletType.Replace("(Clone)", ""); switch (bulletType) { case "Axe": HealthBarUtils.DecreaseHealthBarValue(axeDamage); break; case "WitchBullet": HealthBarUtils.DecreaseHealthBarValue(witchBossBulletDamage); break; case "WitchGranade": HealthBarUtils.DecreaseHealthBarValue(witchBossGranadeDamage); break; case "BlackHole": if (!other.usedByEffector) { HealthBarUtils.DecreaseHealthBarValue(witchBossBlackHoleDamage); } break; case "Granade": HealthBarUtils.DecreaseHealthBarValue(flyingBoyGranadeDamage); break; case "BoyBullet": HealthBarUtils.DecreaseHealthBarValue(boyBossBulletDamage); break; case "BoyBurpBullet": HealthBarUtils.DecreaseHealthBarValue(boyBossBurpDamage); break; default: break; } }