Skip to content

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

License

Notifications You must be signed in to change notification settings

huijian142857/TeaTime

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TeaTime v0.8.4 beta

Download / Examples

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

// In MonoBehaviours
TeaTime queue = this.tt().Add(1, () =>
{
    // The queue autoplays by default
    Debug.Log("Once second later! " + Time.time);
})
.Loop(3, (ttHandler 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.Pause();
queue.Play();
queue.Stop();

Check out the examples! (Work in progress)

Feel free to ask me about it!

By Andrés Villalobos.

Created 2014/12/26 12:21 am ^ Rewritten 2015/09/15 12:28 pm

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%