summaryrefslogtreecommitdiff
path: root/GameCode/RescaleFromDamage.cs
blob: f9e8a29d2583bb24e9d82b5d2693e80ccc63f145 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using UnityEngine;

public class RescaleFromDamage : MonoBehaviour
{
	private ProjectileHit hit;

	private float startScale;

	private void Start()
	{
		startScale = base.transform.localScale.x;
	}

	public void Rescale()
	{
		if (!hit)
		{
			hit = GetComponentInParent<ProjectileHit>();
		}
		if ((bool)hit)
		{
			base.transform.localScale = Vector3.one * startScale * (hit.damage / 55f);
		}
	}
}