Class FeedbackRuntimeExtensions
Extension over IFeedbackRuntime that encapsulates the "wait the unscaled duration (or one frame when the duration is zero/negative) then invoke a callback" coroutine shared by several channels that auto-stop/auto-reset an effect once its duration elapses. Keyed by the same opaque handle Run(IEnumerator, object) uses, so calling RunAfter(IFeedbackRuntime, float, Action, object) again with the same handle cancels (replaces) the previous wait, matching each channel's existing per-effect / per-device cancellation semantics.
Inherited Members
Namespace: Serenity.Feedback.Infrastructure.Channels
Assembly: Serenity.UnityFeedback.Infrastructure.dll
Syntax
public static class FeedbackRuntimeExtensions
Methods
RunAfter(IFeedbackRuntime, float, Action, object)
Waits delaySeconds of unscaled realtime (or a single frame when
delaySeconds is zero or negative, so a caller is never latched on
permanently), then invokes onElapsed. Running the same
handle again cancels this wait.
Declaration
public static void RunAfter(this IFeedbackRuntime runtime, float delaySeconds, Action onElapsed, object handle)
Parameters
| Type | Name | Description |
|---|---|---|
| IFeedbackRuntime | runtime | The coroutine host to run the wait on. |
| float | delaySeconds | Seconds of unscaled realtime to wait before invoking; zero/negative waits one frame instead. |
| Action | onElapsed | Invoked once the wait completes. |
| object | handle | Opaque key; running the same handle again cancels this wait. |