VR Interaction Framework v2.0
Loading...
Searching...
No Matches
BNG.Damageable Class Reference

A basic damage implementation. Call a function on death. Allow for respawning. More...

Inheritance diagram for BNG.Damageable:

Public Member Functions

virtual void DealDamage (float damageAmount)
 
virtual void DealDamage (float damageAmount, Vector3? hitPosition=null, Vector3? hitNormal=null, bool reactToHit=true, GameObject sender=null, GameObject receiver=null)
 
virtual void DestroyThis ()
 

Public Attributes

float Health = 100
 
GameObject SpawnOnDeath
 
List< GameObject > ActivateGameObjectsOnDeath
 
List< GameObject > DeactivateGameObjectsOnDeath
 
List< Collider > DeactivateCollidersOnDeath
 
bool DestroyOnDeath = true
 Destroy this object on Death? False if need to respawn.
 
bool DropOnDeath = true
 
float DestroyDelay = 0f
 How long to wait before destroying this objects.
 
bool Respawn = false
 If true the object will be reactivated according to RespawnTime.
 
float RespawnTime = 10f
 If Respawn true, this gameObject will reactivate after RespawnTime. In seconds.
 
bool RemoveBulletHolesOnDeath = true
 Remove any decals that were parented to this object on death. Useful for clearing unused decals.
 
FloatEvent onDamaged
 
UnityEvent onDestroyed
 
UnityEvent onRespawn
 

Detailed Description

A basic damage implementation. Call a function on death. Allow for respawning.

Member Function Documentation

◆ DealDamage() [1/2]

virtual void BNG.Damageable.DealDamage ( float  damageAmount)
virtual

◆ DealDamage() [2/2]

virtual void BNG.Damageable.DealDamage ( float  damageAmount,
Vector3?  hitPosition = null,
Vector3?  hitNormal = null,
bool  reactToHit = true,
GameObject  sender = null,
GameObject  receiver = null 
)
virtual

◆ DestroyThis()

virtual void BNG.Damageable.DestroyThis ( )
virtual

Member Data Documentation

◆ ActivateGameObjectsOnDeath

List<GameObject> BNG.Damageable.ActivateGameObjectsOnDeath

◆ DeactivateCollidersOnDeath

List<Collider> BNG.Damageable.DeactivateCollidersOnDeath

◆ DeactivateGameObjectsOnDeath

List<GameObject> BNG.Damageable.DeactivateGameObjectsOnDeath

◆ DestroyDelay

float BNG.Damageable.DestroyDelay = 0f

How long to wait before destroying this objects.

◆ DestroyOnDeath

bool BNG.Damageable.DestroyOnDeath = true

Destroy this object on Death? False if need to respawn.

◆ DropOnDeath

bool BNG.Damageable.DropOnDeath = true

◆ Health

float BNG.Damageable.Health = 100

◆ onDamaged

FloatEvent BNG.Damageable.onDamaged

◆ onDestroyed

UnityEvent BNG.Damageable.onDestroyed

◆ onRespawn

UnityEvent BNG.Damageable.onRespawn

◆ RemoveBulletHolesOnDeath

bool BNG.Damageable.RemoveBulletHolesOnDeath = true

Remove any decals that were parented to this object on death. Useful for clearing unused decals.

◆ Respawn

bool BNG.Damageable.Respawn = false

If true the object will be reactivated according to RespawnTime.

◆ RespawnTime

float BNG.Damageable.RespawnTime = 10f

If Respawn true, this gameObject will reactivate after RespawnTime. In seconds.

◆ SpawnOnDeath

GameObject BNG.Damageable.SpawnOnDeath

The documentation for this class was generated from the following file: