Third Person Cover Shooter  1.6
CoverShooter.Grenade Class Reference

Moves the object through the air and causes an explosion event after certain amount of time passes. More...

Inheritance diagram for CoverShooter.Grenade:
CoverShooter.SmokeGrenade CoverShooter.ToxicGrenade

Public Member Functions

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...
 

Public Attributes

GameObject Explosion
 Explosion prefab to instantiate on detonation. More...
 
float ExplosionRadius = 4.5f
 Distance from the explosion center where damage reaches 0. More...
 
float CenterDamage = 150
 Damage done at the center of explosion. More...
 
float Bounciness = 0.3f
 Fraction of velocity retained when bouncing from a surface. More...
 
float Timer = 3
 Explosion timer in seconds counted from activation. More...
 
float ShakeDuration = 0.5f
 Camera shake duration when exploded. More...
 
float ShakeIntensity = 100
 Camera shake intensity when close to the camera. More...
 
GameObject ExplosionPreview
 Prefab to instantiate to display grenade explosion preview. More...
 
float PreviewTime
 Time in seconds since the activation to display the explosion preview. More...
 

Protected Member Functions

virtual void Apply (GameObject target, Vector3 position, Vector3 normal, float fraction)
 

Properties

Actor Attacker [get]
 Manages flight and explosion of a grenade. More...
 

Detailed Description

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.

Member Function Documentation

◆ 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.

Member Data Documentation

◆ 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.

Property Documentation

◆ 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: