Improve exam flow and WebGL build
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using UnityEngine;
|
||||
|
||||
public static class InteractionClickGuard
|
||||
{
|
||||
private static int _lastHandledFrame = -1;
|
||||
private static float _lastHandledTime = -1f;
|
||||
|
||||
public static void MarkHandled()
|
||||
{
|
||||
_lastHandledFrame = Time.frameCount;
|
||||
_lastHandledTime = Time.unscaledTime;
|
||||
}
|
||||
|
||||
public static bool WasHandledThisFrame()
|
||||
{
|
||||
return _lastHandledFrame == Time.frameCount;
|
||||
}
|
||||
|
||||
public static bool WasHandledRecently()
|
||||
{
|
||||
return Time.frameCount - _lastHandledFrame <= 1 ||
|
||||
(Time.unscaledTime - _lastHandledTime >= 0f &&
|
||||
Time.unscaledTime - _lastHandledTime <= 0.1f);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user