mirror of
https://github.com/originalnicodr/CinematicUnityExplorer.git
synced 2026-10-12 02:18:04 +08:00
Fix the onValueChange throttling affecting internal features
This commit is contained in:
1 parent
ea1e183c4a
commit
1c5306b7c8
2 files changed
+22
-2
No files matched your search
+1
-1
@@ -14,7 +14,7 @@ namespace UnityExplorer
|
||||
public class ExplorerCore
|
||||
{
|
||||
public const string NAME = "UnityExplorer";
|
||||
public const string VERSION = "3.3.14";
|
||||
public const string VERSION = "3.3.15";
|
||||
public const string AUTHOR = "Sinai";
|
||||
public const string GUID = "com.sinai.unityexplorer";
|
||||
|
||||
|
||||
@@ -201,6 +201,8 @@ The following helper methods are available:
|
||||
|
||||
public void UpdateConsole()
|
||||
{
|
||||
if (Time.time > s_timeOfLastInternalSet)
|
||||
Writing = false;
|
||||
|
||||
if (EnableCtrlRShortcut)
|
||||
{
|
||||
@@ -259,6 +261,8 @@ The following helper methods are available:
|
||||
|
||||
public void UseAutocomplete(string suggestion)
|
||||
{
|
||||
Writing = true;
|
||||
|
||||
string input = InputField.text;
|
||||
input = input.Insert(m_lastCaretPos, suggestion);
|
||||
InputField.text = input;
|
||||
@@ -274,10 +278,22 @@ The following helper methods are available:
|
||||
}
|
||||
|
||||
private static float s_timeOfLastUpdate;
|
||||
private static bool Writing
|
||||
{
|
||||
get => s_writing;
|
||||
set
|
||||
{
|
||||
if (value)
|
||||
s_timeOfLastInternalSet = Time.time;
|
||||
s_writing = value;
|
||||
}
|
||||
}
|
||||
private static bool s_writing;
|
||||
private static float s_timeOfLastInternalSet;
|
||||
|
||||
public void OnInputChanged(string newText, bool forceUpdate = false)
|
||||
{
|
||||
if (Time.time <= s_timeOfLastUpdate)
|
||||
if (!Writing && Time.time <= s_timeOfLastUpdate)
|
||||
return;
|
||||
|
||||
s_timeOfLastUpdate = Time.time;
|
||||
@@ -285,6 +301,8 @@ The following helper methods are available:
|
||||
if (EnableAutoIndent)
|
||||
UpdateIndent(newText);
|
||||
|
||||
Writing = true;
|
||||
|
||||
if (!forceUpdate && string.IsNullOrEmpty(newText))
|
||||
inputHighlightText.text = string.Empty;
|
||||
else
|
||||
@@ -361,6 +379,8 @@ The following helper methods are available:
|
||||
|
||||
private void AutoIndentCaret()
|
||||
{
|
||||
Writing = true;
|
||||
|
||||
if (CurrentIndent > 0)
|
||||
{
|
||||
string indent = GetAutoIndentTab(CurrentIndent);
|
||||
|
||||
Reference in new issue
Block a user