Loading...
Searching...
No Matches
AdventureCore.DestructibleDamageReceiver Class Reference

Detailed Description

damage receiver that gets destroyed when damaged
will be destroyed by any amount of damage unless attached to a character with a ResourcePool(eg. dummies in AdventureSouls)
can spawn a destroyed object when it is destroyed and push on its rigidbodies(crates)

https://adventure.softleitner.com/manual/damage

Inheritance diagram for AdventureCore.DestructibleDamageReceiver:
AdventureCore.TriggerDamageReceiver AdventureCore.TriggerItem< TriggerDamageSender, TriggerDamageReceiver > AdventureCore.IDamageReceiver AdventureCore.ICharacterAssociator

Public Member Functions

override void PostDamage (IDamageSender sender, List< DamageEvent > events)
 called after alle the damages have been applied
this is a good spot to react to the change of state that has been done by the damages
for example death or destruction if health was reduced to 0 by the damages
 
- Public Member Functions inherited from AdventureCore.TriggerDamageReceiver
virtual bool PreDamage (IDamageSender sender)
 called before any real damage handling to check if the handling is valid and should continue
for example if a character is currently dodging damage handling can be cancelled here
 
virtual void OnDamage (DamageEvent e)
 this is where the main damage handling should take place and damage vectors are assigned
OnDamage is called in the order Sender > Receiver > Damage
for example if a character is wearing protective gear it may reduce the damage value here
this method is called for every damage parameter see DamageEvent for more details
 
- Public Member Functions inherited from AdventureCore.TriggerItem< TriggerDamageSender, TriggerDamageReceiver >
virtual void AddArea (TArea area)
 
virtual void RemoveArea (TArea area)
 

Public Attributes

GameObject DestroyedPrefab
 
ResourceType HealthResource
 
float PushPower = 1
 
DamageKind PushKind
 
float MaximumImpulse
 
float ImpulsePower = 1
 
- Public Attributes inherited from AdventureCore.TriggerDamageReceiver
CharacterBase Character
 
DamageKind[] Filter
 
UnityEvent< DamageEventDamaging
 
UnityEvent< DamageEvent[]> Damaged
 
- Public Attributes inherited from AdventureCore.TriggerItem< TriggerDamageSender, TriggerDamageReceiver >
UnityEvent< TArea > AreaAdded
 
UnityEvent< TArea > AreaRemoved
 

Additional Inherited Members

- Protected Member Functions inherited from AdventureCore.TriggerItem< TriggerDamageSender, TriggerDamageReceiver >
virtual void OnEnable ()
 
virtual void OnDisable ()
 
virtual void onAreaAdded (TArea area)
 
virtual void onAreaRemoved (TArea area)
 
- Protected Attributes inherited from AdventureCore.TriggerItem< TriggerDamageSender, TriggerDamageReceiver >
List< TArea > _areas
 
- Properties inherited from AdventureCore.TriggerDamageReceiver
CharacterBase AssociatedCharacter [get]
 character that owns or is otherwise associted with the object
 
- Properties inherited from AdventureCore.TriggerItem< TriggerDamageSender, TriggerDamageReceiver >
IReadOnlyList< TArea > Areas [get]
 
- Properties inherited from AdventureCore.ICharacterAssociator

Member Function Documentation

◆ PostDamage()

override void AdventureCore.DestructibleDamageReceiver.PostDamage ( IDamageSender sender,
List< DamageEvent > events )
inlinevirtual

called after alle the damages have been applied
this is a good spot to react to the change of state that has been done by the damages
for example death or destruction if health was reduced to 0 by the damages

Parameters
sender
events

Reimplemented from AdventureCore.TriggerDamageReceiver.