initial commit

This commit is contained in:
2026-10-12 21:28:47 +01:00
commit 6dd11d33ae
11551 changed files with 2353518 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
using UnityEngine;
public class HealthPickup : PickupItem
{
[Header("Health Settings")]
[SerializeField] private int healAmount = 25;
[SerializeField] private bool onlyCollectWhenDamaged = true;
protected override bool CanCollect(GameObject player)
{
if (PlayerHealthController.Instance == null) return false;
if (PlayerHealthController.Instance.IsDead) return false;
if (onlyCollectWhenDamaged)
{
return PlayerHealthController.Instance.CurrentHealth < PlayerHealthController.Instance.MaxHealth;
}
return true;
}
protected override void ApplyPickupEffect(GameObject player)
{
if (PlayerHealthController.Instance != null)
{
PlayerHealthController.Instance.Heal(healAmount);
}
}
}