mirror of
https://github.com/Cysharp/UniTask.git
synced 2026-05-22 07:40:12 +00:00
Add UniTask.Post
This commit is contained in:
@@ -173,7 +173,14 @@ namespace Cysharp.Threading.Tasks.Internal
|
|||||||
var action = actionList[i];
|
var action = actionList[i];
|
||||||
actionList[i] = null;
|
actionList[i] = null;
|
||||||
|
|
||||||
action();
|
try
|
||||||
|
{
|
||||||
|
action();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
UnityEngine.Debug.LogException(ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -44,6 +44,14 @@ namespace Cysharp.Threading.Tasks
|
|||||||
return new ReturnToMainThread(timing);
|
return new ReturnToMainThread(timing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Queue the action to PlayerLoop.
|
||||||
|
/// </summary>
|
||||||
|
public static void Post(Action action, PlayerLoopTiming timing = PlayerLoopTiming.Update)
|
||||||
|
{
|
||||||
|
PlayerLoopHelper.AddContinuation(timing, action);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public static SwitchToThreadPoolAwaitable SwitchToThreadPool()
|
public static SwitchToThreadPoolAwaitable SwitchToThreadPool()
|
||||||
|
|||||||
Reference in New Issue
Block a user