Moves the object through the air and causes an explosion event after certain amount of time passes.
More...
|
void | Fly (Vector3 origin, Vector3 velocity, float gravity) |
| Launched the grenade on flight with giver parameters. More...
|
|
void | Activate (Actor attacker, float delay=0) |
| Sets the grenade to explode on collision. More...
|
|
|
virtual void | Apply (GameObject target, Vector3 position, Vector3 normal, float fraction) |
|
Moves the object through the air and causes an explosion event after certain amount of time passes.
By default causes damage to surrounding objects with CharacterHealth.
◆ Activate()
void CoverShooter.Grenade.Activate |
( |
Actor |
attacker, |
|
|
float |
delay = 0 |
|
) |
| |
Sets the grenade to explode on collision.
◆ Apply()
virtual void CoverShooter.Grenade.Apply |
( |
GameObject |
target, |
|
|
Vector3 |
position, |
|
|
Vector3 |
normal, |
|
|
float |
fraction |
|
) |
| |
|
protectedvirtual |
◆ Fly()
void CoverShooter.Grenade.Fly |
( |
Vector3 |
origin, |
|
|
Vector3 |
velocity, |
|
|
float |
gravity |
|
) |
| |
Launched the grenade on flight with giver parameters.
◆ Bounciness
float CoverShooter.Grenade.Bounciness = 0.3f |
Fraction of velocity retained when bouncing from a surface.
◆ CenterDamage
float CoverShooter.Grenade.CenterDamage = 150 |
Damage done at the center of explosion.
◆ Explosion
GameObject CoverShooter.Grenade.Explosion |
Explosion prefab to instantiate on detonation.
◆ ExplosionPreview
GameObject CoverShooter.Grenade.ExplosionPreview |
Prefab to instantiate to display grenade explosion preview.
◆ ExplosionRadius
float CoverShooter.Grenade.ExplosionRadius = 4.5f |
Distance from the explosion center where damage reaches 0.
◆ PreviewTime
float CoverShooter.Grenade.PreviewTime |
Time in seconds since the activation to display the explosion preview.
◆ ShakeDuration
float CoverShooter.Grenade.ShakeDuration = 0.5f |
Camera shake duration when exploded.
◆ ShakeIntensity
float CoverShooter.Grenade.ShakeIntensity = 100 |
Camera shake intensity when close to the camera.
◆ Timer
float CoverShooter.Grenade.Timer = 3 |
Explosion timer in seconds counted from activation.
◆ Attacker
Actor CoverShooter.Grenade.Attacker |
|
get |
Manages flight and explosion of a grenade.
Flight and collisions are performed using raycasts. Grenades can bounce. Upon explosion a prefab is instantiated on grenades location. Grenade affects Character Health and Body Part Health objects in its explosion area. Damage is highest in the epicentre and decreases linearly to zero on the edge of the explosion area.
The documentation for this class was generated from the following file:
- E:/Projects/tpcs/Assets/ThirdPersonCoverShooter/Scripts/Weapons/Grenade.cs