Skip to content

TeaTime is a fast and straightforward queue for timed callbacks, specifically designed to address common coroutine patterns in Unity games.

License

Notifications You must be signed in to change notification settings

alvivar/TeaTime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TeaTime

TeaTime is a fast & simple queue for timed callbacks, focused on solving common coroutines patterns in Unity games.

// Inside MonoBehaviours
TeaTime queue = this.tt().Add(1, () =>
{
    // The queue autoplays by default
    Debug.Log($"One second later! {Time.time}");
})
.Loop(3, (TeaHandler loop) =>
{
    // This callback is repeated per frame during the loop duration
    transform.position =
        Vector3.Lerp(
            transform.position,
            transform.position + Random.insideUnitSphere,
            loop.deltaTime // deltaTime sincronized with the loop duration
        );
})
.Add(() =>
{
    Debug.Log($"The loop is done! {Time.time}");
})
.Repeat(); // Repeats forever!

// And more!
queue.Reverse();
queue.Yoyo();
queue.Immutable();

Check out the examples and the API.

About

TeaTime is a fast and straightforward queue for timed callbacks, specifically designed to address common coroutine patterns in Unity games.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages