Timer Code Block

$7
Publisher Code Blocks
File size 29.11kB
Number of files 8
Latest version 1
Latest release date 2020-03-26 12:38:10
First release date 2020-04-16 03:40:24
Supported Unity versions 2018.4.2 or higher

Timers and wait conditions are a key feature in game development. This package contain a comprehensive, effective and easy set of C# classes to use implementation for timer and wait condition, that will speed up your development and reduce the bugs, and avoiding spread and repeat timer codes on your Update methods or overuse Coroutines,


This package contains three timer blocks for use in Unity development.


1) SingleTimer: A timer to be used to trigger a function one or more times in a defined period. SingleTimer timer1 = new SingleTimer(2.0f, TimerFunction);


2) ConditionTimer: A wait to a condition class to test any condition, with timeout, and callback function ConditionTimer timer2 = new ConditionTimer(LowHealth, RecoverHealth, 10.0f);


3) TimerBlock: A class to implement a centralized solution for your timer and wait condition needs This class implements a timer manager that allows you to schedule tasks and add wait conditions in a single place. mainTimer = new TimerBlock(timeBase); // Add an wait condition mainTimer.Wait(waitCondition, doAction, timeOut); // Add a scheduled action mainTimer.Schedule(callback, time, repeat);


4) TimerManager: A ready to use prefab implementing a time manager using TimerBlock class. This Prefab runs across scenes and is not destroyed.

Top Publisher Assets