For AI agents: the complete documentation index is available at /AchEngine/ja/llms.txt, the full documentation bundle is available at /AchEngine/ja/llms-full.txt, and this page is available as Markdown at /AchEngine/ja/usage/timer.md.

AchTimer

AchTimer は async/await ベースの待機・進行追跡ユーティリティです。

await AchTimer.Wait(3f);
await AchTimer.WaitRealtime(3f);

var timer = AchTimer.Start(5f);
await timer;

Wait はゲーム時間、WaitRealtime は timeScale に依存しない実時間を使います。AchTimerHandle には Duration、Elapsed、Remaining、Progress、IsDone、IsCancelled、Task があります。

var cts = new CancellationTokenSource();
var castTimer = AchTimer.Start(2f, cancellationToken: cts.Token);
castBar.Bind(castTimer);
try { await castTimer; FireSkill(); }
catch (TaskCanceledException) { ShowCancelMessage(); }

useUnscaledTime: true で実時間にし、UIAchTimer.Bind(handle) で Text と Slider に表示できます。完了時は自動 Unbind されます。

関連ドキュメント