summaryrefslogtreecommitdiff
path: root/GameCode/ScaleWithHp.cs
blob: 5649021669d0b2241e505cc048ea260a7fa74a3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
using UnityEngine;

public class ScaleWithHp : MonoBehaviour
{
	private DamagableEvent dmg;

	public AnimationCurve curve;

	private void Start()
	{
		dmg = GetComponentInParent<DamagableEvent>();
	}

	private void Update()
	{
		base.transform.localScale = Vector3.one * curve.Evaluate(dmg.currentHP);
	}
}