Implement health modification on enemy kill; add HealOnKillModifier and update death behavior

This commit is contained in:
2025-07-12 12:57:21 +02:00
parent cb793bcc93
commit c3b1ac9213
22 changed files with 330 additions and 11 deletions

View File

@@ -0,0 +1,30 @@
using System.Collections.Generic;
using UnityEngine;
using Weapons;
namespace Systems
{
public class EnemyWeaponTargetSetter : MonoBehaviour
{
[SerializeField] private List<AutoWeapon> weapons = new();
[SerializeField] private Transform target;
private void Reset()
{
if (weapons.Count == 0)
{
weapons = new List<AutoWeapon>(GetComponentsInChildren<AutoWeapon>());
}
}
private void Update()
{
if (!target || weapons.Count == 0) return;
foreach (var weapon in weapons)
{
weapon.Target = target.position;
}
}
}
}