Initialisation

This commit is contained in:
darriyano
2025-04-26 18:30:58 +03:00
commit 6737be11fc
353 changed files with 41379 additions and 0 deletions
@@ -0,0 +1,38 @@
using UnityEngine;
public class PlayerOverheatReset : MonoBehaviour
{
public BarClickHighlighter overheatScript;
public HealthManager healthManager;
public int healAmount = 20;
public float healCooldown = 5f; // Кулдаун между лечениями (в секундах)
private float lastHealTime = -Mathf.Infinity;
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Platform"))
{
if (Time.time >= lastHealTime + healCooldown)
{
Debug.Log("ON A PLATFORM — Healed!");
if (overheatScript != null)
{
overheatScript.ResetOverheat();
}
if (healthManager != null)
{
healthManager.heal(healAmount);
}
lastHealTime = Time.time; // Обновляем момент последнего лечения
}
else
{
Debug.Log("Platform on cooldown...");
}
}
}
}