summaryrefslogtreecommitdiff
path: root/GameCode/ObjectScaleToBulletStats.cs
blob: da5e7d692676ec8779286780f82ebc758f01e4a3 (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
using UnityEngine;

public class ObjectScaleToBulletStats : MonoBehaviour
{
	public GameObject target;

	public float dmgAmount = 1f;

	public float speedAmount = 1f;

	private void Start()
	{
		ProjectileHit component = GetComponent<ProjectileHit>();
		MoveTransform component2 = GetComponent<MoveTransform>();
		if ((bool)component)
		{
			component.damage = Mathf.Lerp(component.damage, component.damage * target.transform.localScale.x, dmgAmount);
		}
		if ((bool)component2)
		{
			component2.localForce.z = Mathf.Lerp(component2.localForce.z, component2.localForce.z * target.transform.localScale.x, speedAmount);
		}
	}
}