Skip to content

Latest commit

 

History

History
30 lines (24 loc) · 1.21 KB

README.md

File metadata and controls

30 lines (24 loc) · 1.21 KB

Delay

Simple delay class to execute code after a certain amount of time in Unity.

openupm

Installation

There are multiple ways to install this package into your project:

  • Add it to your project through OpenUPM (recommended)
  • Add the package to the Unity package manager using the HTTPS URL of this repository (recommended)
  • Download the whole repository as a .zip and place the contents into a subfolder in your assets folder
  • Fork the repository and add it as a submodule in git

Usage

using Timing;
using UnityEngine;

public class FooBar : MonoBehaviour
{
    public void Start()
    {
        Delay.Create(1f, () => Debug.Log("I will be executed after 1 second."));
        
        Delay.WaitUntil(() => Time.time >= 5f, () => Debug.Log("I will wait until the provided condition is true."));
    }
}

Collaboration

Support this project with a ⭐️, report an issue or if you feel adventurous and would like to extend the functionality open a pull request.