public HealthRegenEvent(IHealth target, IHealthSource source, float amount) { Target = target; Source = source; Amount = amount; StartHealth = target.Current; EndHealth = Mathf.Clamp(target.Current + amount, 0, target.Max); HealthChange = EndHealth - StartHealth; StartMaxHealth = target.Max; EndMaxHealth = target.Max; }
public HealthStatsEvent(IHealth target, IHealthStatsInfo stats) { Target = target; Source = stats.Source; StartHealth = target.Current; EndHealth = stats.Current; HealthChange = EndHealth - StartHealth; StartMaxHealth = target.Max; EndMaxHealth = stats.Max; }
public virtual void Reset(IHealthSource healthSource, Transform spawnPoint) { HealthStatsInfo healthStatsInfo = new HealthStatsInfo(healthSource, unit.Health.Max, unit.Health.Max); unit.Health.SetStats(healthStatsInfo); movement.Reset(spawnPoint); foreach(Ability ability in unit.Abilities) { ability.Reset(); } enabled = true; StopAll(); unit.Ragdoll.Hide(); unit.gameObject.SetActive(true); }
public HealthStatsInfo(IHealthSource source, IHealth original, float newHealth) { Source = source; Current = newHealth; Max = original.Max; }
public HealthStatsInfo(IHealthSource source, float current, float max) { Source = source; Current = current; Max = max; }