Skip to content

Simplified and debuggable alternative to Invoke, InvokeRepeating and Coroutines in Unity.

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta
Notifications You must be signed in to change notification settings

virtualplaynl/UnityDelayedActions

Repository files navigation

DelayedActions for Unity

Simplified and debuggable alternative to Invoke, InvokeRepeating and Coroutines.

Installation

To add this to a Unity project:

Usage

In any script, use DelayedActions.Start(...) to start an action after the specified delay, optionally repeating. The function returns a DelayedAction object, which you can store to later check its state, change its properties or stop it before its (next) execution.

Another feature of this script enables you to run code that needs to run on the main Unity thread, from anywhere, by calling DelayedActions.NextUpdate(Action) or DelayedActions.NextFixedUpdate(Action). The provided Action will then be executed in the next Update or FixedUpdate by the Scheduler.

Destroy on scene load

By default, the Delayed Action Scheduler object that's created, will be persistent across Scene loads, meaning that any delayed actions started will still trigger after loading a new Scene. If you don't want this, set DelayedActions.DestroyOnLoad = true before starting your first DelayedAction.

About

Simplified and debuggable alternative to Invoke, InvokeRepeating and Coroutines in Unity.

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages