using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Saltosion.OneWeapon { public class Health : MonoBehaviour { public float MaxHealth; public float CurrentHealth; private PlayerFun PlayerFun; private void Start() { PlayerFun = GameObject.FindGameObjectWithTag("Player").GetComponent(); } public void Damage(float amount, Vector2 fromDirection) { BloodLauncher.Splatter(transform.position, -fromDirection, (int)(amount), 100f, 100); MaxHealth -= amount * (1 + PlayerFun.CurrentDamageBoost); if (MaxHealth <= 0) { MaxHealth = 0; } } } }