blob: ebc37f794a630f4630c4f415f7f34786508734d7 (
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
26
27
28
|
using UnityEngine;
public class RescaleFromDamagePart : MonoBehaviour
{
private ProjectileHit hit;
private float startSize;
private ParticleSystem part;
private void Start()
{
part = GetComponent<ParticleSystem>();
startSize = part.startSize;
}
public void Rescale()
{
if (!hit)
{
hit = GetComponentInParent<ProjectileHit>();
}
if ((bool)hit)
{
part.startSize = startSize * (hit.damage / 55f);
}
}
}
|