mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-03 03:52:28 +08:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
1c5306b7c8 | |||
ea1e183c4a | |||
8080129d58 | |||
4b8298fd2e | |||
ad055b4383 |
@ -6,6 +6,10 @@
|
||||
An in-game explorer and a suite of debugging tools for <a href="https://docs.unity3d.com/Manual/IL2CPP.html">IL2CPP</a> and <b>Mono</b> Unity games, to aid with modding development.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
Supports most Unity games from versions 5.2 to 2020+.
|
||||
</p>
|
||||
|
||||
## Releases [](../../releases/latest) [](../../releases) [](../../releases/latest)
|
||||
|
||||
| Mod Loader | IL2CPP | Mono |
|
||||
|
@ -62,7 +62,7 @@ namespace UnityExplorer.Core.Input
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ExplorerCore.LogWarning($"Exception setting up Camera.onPostRender callback: {ex}");
|
||||
ExplorerCore.LogWarning($"Exception setting up Aggressive Mouse Unlock: {ex}");
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,9 +72,7 @@ namespace UnityExplorer.Core.Input
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
ExplorerCore.Log("Yielding end of frame");
|
||||
yield return _waitForEndOfFrame;
|
||||
ExplorerCore.Log("Yielded");
|
||||
|
||||
if (UIManager.ShowMenu)
|
||||
UpdateCursorControl();
|
||||
|
@ -14,7 +14,7 @@ namespace UnityExplorer
|
||||
public class ExplorerCore
|
||||
{
|
||||
public const string NAME = "UnityExplorer";
|
||||
public const string VERSION = "3.3.13";
|
||||
public const string VERSION = "3.3.15";
|
||||
public const string AUTHOR = "Sinai";
|
||||
public const string GUID = "com.sinai.unityexplorer";
|
||||
|
||||
|
@ -199,23 +199,10 @@ The following helper methods are available:
|
||||
InputField.onValueChanged.AddListener((string s) => { OnInputChanged(s); });
|
||||
}
|
||||
|
||||
internal static bool IsUserCopyPasting()
|
||||
{
|
||||
return (InputManager.GetKey(KeyCode.LeftControl) || InputManager.GetKey(KeyCode.RightControl))
|
||||
&& InputManager.GetKeyDown(KeyCode.V);
|
||||
}
|
||||
|
||||
public void UpdateConsole()
|
||||
{
|
||||
if (s_copyPasteBuffer != null)
|
||||
{
|
||||
if (!IsUserCopyPasting())
|
||||
{
|
||||
OnInputChanged(s_copyPasteBuffer);
|
||||
|
||||
s_copyPasteBuffer = null;
|
||||
}
|
||||
}
|
||||
if (Time.time > s_timeOfLastInternalSet)
|
||||
Writing = false;
|
||||
|
||||
if (EnableCtrlRShortcut)
|
||||
{
|
||||
@ -274,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;
|
||||
@ -288,20 +277,32 @@ The following helper methods are available:
|
||||
AutoCompleter.ClearAutocompletes();
|
||||
}
|
||||
|
||||
internal static string s_copyPasteBuffer;
|
||||
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 (IsUserCopyPasting())
|
||||
{
|
||||
//Console.WriteLine("Copy+Paste detected!");
|
||||
s_copyPasteBuffer = newText;
|
||||
if (!Writing && Time.time <= s_timeOfLastUpdate)
|
||||
return;
|
||||
}
|
||||
|
||||
s_timeOfLastUpdate = Time.time;
|
||||
|
||||
if (EnableAutoIndent)
|
||||
UpdateIndent(newText);
|
||||
|
||||
Writing = true;
|
||||
|
||||
if (!forceUpdate && string.IsNullOrEmpty(newText))
|
||||
inputHighlightText.text = string.Empty;
|
||||
else
|
||||
@ -378,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