Class UtilityExtensions
- Namespace
- SkyrimForge
- Assembly
- SkyrimForge.dll
Provides extension members for IUtility.
public static class UtilityExtensions
- Inheritance
-
UtilityExtensions
- Inherited Members
Methods
WaitForGameThreadAsync(IUtility, CancellationToken)
Waits for the next frame, so the code after the await runs on the game's thread.
public static Task WaitForGameThreadAsync(this IUtility utility, CancellationToken cancellationToken = default)
Parameters
utilityIUtilitycancellationTokenCancellationTokenCancels the wait on the next frame. A new game or a save load also cancels it.
Returns
Remarks
A handler of an event raised on a worker thread awaits this before it calls a member documented as called on the game's thread.
WaitSeconds(IUtility, float, CancellationToken)
Waits for seconds of UnpausedTime.
public static Task WaitSeconds(this IUtility utility, float seconds, CancellationToken cancellationToken = default)
Parameters
utilityIUtilitysecondsfloatThe duration in seconds. Zero or less completes on the next frame.
cancellationTokenCancellationTokenCancels the wait on the next frame. A new game or a save load also cancels it.
Returns
- Task
A task that completes on the first frame at least
secondslater.