Skip to content
Snippets Groups Projects
Commit f0c53827 authored by Robin Halseth Sandvik's avatar Robin Halseth Sandvik
Browse files

Added `IsCharging` to indicate if the ability is charging or not.

parent b1bafae1
No related branches found
No related tags found
1 merge request!84Merge, ability cluster
......@@ -24,12 +24,14 @@ namespace BigSock {
public List<KeyCode> Keys { get; }
// Indicates whether or not the ability is charging.
public bool IsCharging => ChargeStarted > 0;
// The time this ability has been charging.
public float ChargeTime => Time.time - ChargeStarted;
// The percent of maximum time the ability has charged for.
public float ChargePercent => (Ability.FireType == FireType.Charge && ChargeStarted > 0)
public float ChargePercent => (Ability.FireType == FireType.Charge && IsCharging)
? Math.Clamp(ChargeTime / Ability.MaxCharge, 0, 1)
: 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment