Global Timer

The following script can be used to automatically reduce a Global Integer variable's value by 1 every second, and run an ActionList asset when it hits zero.

To use it, paste the following code into a C# script named VariableTimer.cs, and add the Variable Timer component to your scene. Configure its Inspector to create a new timer by assigning the ID number of the variable you wish to countdown.

To have the timer begin, either check "Run On Awake", or use either the "Object: Call event" or "Object: Send message" Actions to call the component's "Begin" function.

VariableTimer.cs: