Cooldown

Merlins Beard . Core . Cooldown

The Cooldown component sits on the Attack component and uses a coroutine which fires off events that blocks the execution of the Attack component.

Internal Classes

Countdown Event : Unity Event <float>

Serialized Fields

Cooldown is the amount of time in seconds before an Attack can be triggered again.

Cooldown Started Event

This is a Countdown Event.

The Cooldown Started event is triggered when the Attack is Executed by the Cooldown coroutine. It is used primarily to update the GUI.

Cooldown Updated Event

This is a Countdown Event.

The Cooldown Updated event is triggered from the Cooldown coroutine at the end of every Fixed Update. It is used primarily to update the GUI.

Cooldown Ended Event

This is a Countdown Event.

The Cooldown Ended event is triggeted just before the Cooldown coroutine finishes. It is used primarily to update the GUI.

Methods

Start Cooldown ( )

This method is used to start the Countdown coroutine and guard against starting more than one.


Countdown ( ) > IEnumerator

This coroutine runs a countdown timer which fires off an event during Fixed Update and it invokes events when the coroutine starts and ends as well.