Eye of the Nile Docs
Everything you need to know to get started!
Loading...
Searching...
No Matches
PlayerKnockbackFeedback Class Reference

Detailed Description

Inheriting from KnockbackFeedback, this script will adjust the knockback resistance based on stat modifiers added to the player.

Documentation updated 10/11/2024

Author
Stephen Nuttall

Private Member Functions

void OnEnable ()
 Subscribe to events.
 
void OnDisable ()
 Unsubscribe from events.
 
void addKbResistance (string modiferName, float modiferValue)
 If the given stat modifier is a knockback resistance modifier, add the modifier's value to the overall knockback resistance.
 
void removeKbResistance (string modiferName, float modiferValue)
 If the given stat modifier is a knockback resistance modifier, remove the modifier's value to the overall knockback resistance.
 

Additional Inherited Members

- Public Member Functions inherited from KnockbackFeedback
void ApplyKnockback (GameObject sender)
 Applies knockback to this object by adding force in the opposite direction of the sender.
 
void ApplyKnockback (GameObject sender, float strength)
 Applies knockback to this object by adding force in the opposite direction of the sender. This overload allows one to specify the strength of the knockback.
 
- Public Attributes inherited from KnockbackFeedback
UnityEvent OnBegin
 Event that is triggered when the knockback begins to be applied. Functions can be subscribed to this events in the Unity Editor.
 
UnityEvent OnDone
 Event that is triggered when the knockback begins to be applied. Functions can be subscribed to this events in the Unity Editor.
 
- Protected Attributes inherited from KnockbackFeedback
float kbDelay = 0.15f
 How long after the knockback starts the force on the force should stop being applied.
 
float defaultStrength = 50
 The strength of the knockback (amount of force applied) if no strength is given.
 
float kbResistance = 0
 The amount of strength subtracted from any knockback applied to this object.
 

Member Function Documentation

◆ addKbResistance()

void PlayerKnockbackFeedback.addKbResistance ( string modiferName,
float modiferValue )
private

If the given stat modifier is a knockback resistance modifier, add the modifier's value to the overall knockback resistance.

◆ OnDisable()

void PlayerKnockbackFeedback.OnDisable ( )
private

Unsubscribe from events.

◆ OnEnable()

void PlayerKnockbackFeedback.OnEnable ( )
private

Subscribe to events.

◆ removeKbResistance()

void PlayerKnockbackFeedback.removeKbResistance ( string modiferName,
float modiferValue )
private

If the given stat modifier is a knockback resistance modifier, remove the modifier's value to the overall knockback resistance.


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