Prevent very niche recursion situation

This commit is contained in:
Sinai 2021-05-26 17:41:38 +10:00
parent 805aff07cc
commit b51b743df4

View File

@ -248,6 +248,8 @@ namespace UnityExplorer.UI.CSConsole
UpdateCaret(out _);
}
private static float timeOfLastCtrlR;
public static void Update()
{
if (SRENotSupported)
@ -269,8 +271,10 @@ namespace UnityExplorer.UI.CSConsole
if (EnableCtrlRShortcut
&& (InputManager.GetKey(KeyCode.LeftControl) || InputManager.GetKey(KeyCode.RightControl))
&& InputManager.GetKeyDown(KeyCode.R))
&& InputManager.GetKeyDown(KeyCode.R)
&& timeOfLastCtrlR.OccuredEarlierThanDefault())
{
timeOfLastCtrlR = Time.realtimeSinceStartup;
Evaluate(Panel.Input.Text);
}
}