We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cd0755b + ec29437 commit 8605531Copy full SHA for 8605531
UnityMainThreadDispatcher.cs
@@ -46,6 +46,20 @@ public void Enqueue(IEnumerator action) {
46
});
47
}
48
49
+
50
+ /// <summary>
51
+ /// Locks the queue and adds the Action to the queue
52
+ /// </summary>
53
+ /// <param name="action">function that will be executed from the main thread.</param>
54
+ public void Enqueue(Action action)
55
+ {
56
+ Enqueue(ActionWrapper(action));
57
+ }
58
+ IEnumerator ActionWrapper(Action a)
59
60
+ a();
61
+ yield return null;
62
63
64
65
private static UnityMainThreadDispatcher _instance = null;
0 commit comments