Demon part (2/3) missing files

This commit is contained in:
Szymon Miś
2025-08-13 07:18:27 +02:00
parent 7d57c0f4c6
commit 4b945fb7f4
12 changed files with 25546 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
using UnityEngine;
public class ShieldScaleUp : MonoBehaviour
{
[Tooltip("Time it takes to fully grow the shield")]
public float growDuration = 0.5f;
[Tooltip("Curve to control growth speed over time")]
public AnimationCurve scaleCurve = AnimationCurve.EaseInOut(0, 0, 1, 1);
private float timer = 0f;
private Vector3 targetScale;
private void Awake()
{
targetScale = transform.localScale;
transform.localScale = Vector3.zero;
}
private void OnEnable()
{
timer = 0f;
transform.localScale = Vector3.zero;
}
private void Update()
{
if (timer < growDuration)
{
timer += Time.deltaTime;
float t = Mathf.Clamp01(timer / growDuration);
float scaleValue = scaleCurve.Evaluate(t);
transform.localScale = targetScale * scaleValue;
}
}
}