-
Notifications
You must be signed in to change notification settings - Fork 116
/
create an explosion.cs
31 lines (21 loc) · 1012 Bytes
/
create an explosion.cs
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
29
30
31
//The most basic explosion function. Give a position and a strength and the rest is assumed from these values.
ExplosionCreator.Explode(transform.position, 2);
// -- OR --
//Call the full explosion function for more control
ExplosionCreator.Explode(new ExplosionCreator.ExplosionParameters
{
//Explosion center
Position = transform.position,
//Should particles be created and sound played?
CreateParticlesAndSound = true,
//Should the particles, if created, be that of a large explosion?
LargeExplosionParticles = false,
//The chance that limbs are torn off (0 - 1, 1 meaning all limbs and 0 meaning none)
DismemberChance = 0.1f,
//The amount of force for each "fragment" of the explosion. 8 is a pretty powerful explosion. 2 is a regular explosion.
FragmentForce = 8,
//The amount of rays cast to simulate fragments. More rays is more lag but higher precision
FragmentationRayCount = 32,
//The ultimate range of the explosion
Range = 10
});