ActionAdventureKit 1.8.0
|
damage sender that damages TriggerDamageReceiver when unity trigger events occur (OnTriggerEnter/OnTriggerExit(2D))
Public Types | |
enum | DirectionMode { Forward , Up , Right , SenderToReceiver , SenderToReceiverXZ , None } |
Public Member Functions | |
virtual void | Activate () |
virtual void | Activate (float modifier) |
virtual void | Deactivate () |
void | Send () |
virtual void | SendCharacterMessages (string e) |
virtual void | SendCharacterMessage (string e) |
virtual Vector3 | GetPosition () |
position of the receiver, may be used to determine damage direction | |
virtual Vector3 | GetDirection (IDamageReceiver receiver) |
calculates direction of damage between this sender and a receiver | |
virtual bool | PreDamage (IDamageReceiver receiver) |
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 | |
virtual void | PostDamage (IDamageReceiver receiver, 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.TriggerArea< TriggerDamageSender, TriggerDamageReceiver > | |
virtual void | AddItem (TItem item) |
virtual void | RemoveItem (TItem item) |
Public Attributes | |
CharacterBase | Character |
DamageParameter[] | Damages |
DirectionMode | Direction |
float | Magnitude = 0f |
bool | SendStart = true |
bool | SendTick = false |
bool | SendEnd = false |
float | TickRate |
bool | SendOnce |
UnityEvent | Damaged |
Public Attributes inherited from AdventureCore.TriggerArea< TriggerDamageSender, TriggerDamageReceiver > | |
UnityEvent< TItem > | ItemAdded |
UnityEvent< TItem > | ItemRemoved |
UnityEvent | ItemsChanged |
Protected Member Functions | |
virtual void | Update () |
override void | OnDisable () |
override void | onItemAdded (TriggerDamageReceiver item) |
override void | onItemRemoved (TriggerDamageReceiver item) |
virtual void | assignDamageVector (DamageEvent e) |
Protected Member Functions inherited from AdventureCore.TriggerArea< TriggerDamageSender, TriggerDamageReceiver > | |
virtual void | OnEnable () |
virtual void | OnTriggerEnter2D (Collider2D collider) |
virtual void | OnTriggerExit2D (Collider2D collider) |
virtual void | OnTriggerEnter (Collider collider) |
virtual void | OnTriggerExit (Collider collider) |
void | clear () |
virtual void | tryAdd (Component component) |
virtual void | tryRemove (Component component) |
virtual void | onItemAdded (TItem item) |
virtual void | onItemRemoved (TItem item) |
Protected Attributes | |
Dictionary< TriggerDamageReceiver, DamageInstance > | _instances = new Dictionary<TriggerDamageReceiver, DamageInstance>() |
List< TriggerDamageReceiver > | _sent = new List<TriggerDamageReceiver>() |
List< CharacterBase > | _sentCharacters = new List<CharacterBase>() |
float | _modifier = 1f |
Protected Attributes inherited from AdventureCore.TriggerArea< TriggerDamageSender, TriggerDamageReceiver > | |
Dictionary< TItem, int > | _items |
Properties | |
CharacterBase | AssociatedCharacter [get] |
character that owns or is otherwise associted with the object | |
Properties inherited from AdventureCore.TriggerArea< TriggerDamageSender, TriggerDamageReceiver > | |
IEnumerable< TItem > | Items [get] |
Properties inherited from AdventureCore.IDamageSender | |
Properties inherited from AdventureCore.ICharacterAssociator |
|
inlinevirtual |
calculates direction of damage between this sender and a receiver
receiver |
Implements AdventureCore.IDamageSender.
Reimplemented in AdventureCore.MovingDamageSender.
|
inlinevirtual |
position of the receiver, may be used to determine damage direction
Implements AdventureCore.IDamageSender.
|
inlinevirtual |
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
e |
Implements AdventureCore.IDamageSender.
|
inlineprotectedvirtual |
Reimplemented from AdventureCore.TriggerArea< TriggerDamageSender, TriggerDamageReceiver >.
|
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
sender | |
events |
Implements AdventureCore.IDamageSender.
Reimplemented in AdventureCore.ProjectileDamageSender.
|
inlinevirtual |
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
receiver |
Implements AdventureCore.IDamageSender.
Reimplemented in AdventureCore.ProjectileDamageSender.
|
get |
character that owns or is otherwise associted with the object
Implements AdventureCore.ICharacterAssociator.