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
|
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.
|
|
|
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.
|
|
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.
|
|
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.
|
|
◆ 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 |
◆ OnEnable()
void PlayerKnockbackFeedback.OnEnable |
( |
| ) |
|
|
private |
◆ 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: