mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-04 04:22:53 +08:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
1c5306b7c8 | |||
ea1e183c4a | |||
8080129d58 | |||
4b8298fd2e | |||
ad055b4383 | |||
23483a6108 |
@ -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.
|
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>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
Supports most Unity games from versions 5.2 to 2020+.
|
||||||
|
</p>
|
||||||
|
|
||||||
## Releases [](../../releases/latest) [](../../releases) [](../../releases/latest)
|
## Releases [](../../releases/latest) [](../../releases) [](../../releases/latest)
|
||||||
|
|
||||||
| Mod Loader | IL2CPP | Mono |
|
| Mod Loader | IL2CPP | Mono |
|
||||||
|
@ -19,6 +19,7 @@ namespace UnityExplorer.Core.Config
|
|||||||
|
|
||||||
public static ConfigElement<KeyCode> Main_Menu_Toggle;
|
public static ConfigElement<KeyCode> Main_Menu_Toggle;
|
||||||
public static ConfigElement<bool> Force_Unlock_Mouse;
|
public static ConfigElement<bool> Force_Unlock_Mouse;
|
||||||
|
public static ConfigElement<bool> Aggressive_Force_Unlock;
|
||||||
public static ConfigElement<MenuPages> Default_Tab;
|
public static ConfigElement<MenuPages> Default_Tab;
|
||||||
public static ConfigElement<int> Default_Page_Limit;
|
public static ConfigElement<int> Default_Page_Limit;
|
||||||
public static ConfigElement<string> Default_Output_Path;
|
public static ConfigElement<string> Default_Output_Path;
|
||||||
@ -78,6 +79,10 @@ namespace UnityExplorer.Core.Config
|
|||||||
"Force the Cursor to be unlocked (visible) when the UnityExplorer menu is open.",
|
"Force the Cursor to be unlocked (visible) when the UnityExplorer menu is open.",
|
||||||
true);
|
true);
|
||||||
|
|
||||||
|
Aggressive_Force_Unlock = new ConfigElement<bool>("Aggressive Mouse Unlock",
|
||||||
|
"Use WaitForEndOfFrame to aggressively force the Mouse to be unlocked (requires game restart).",
|
||||||
|
false);
|
||||||
|
|
||||||
Default_Page_Limit = new ConfigElement<int>("Default Page Limit",
|
Default_Page_Limit = new ConfigElement<int>("Default Page Limit",
|
||||||
"The default maximum number of elements per 'page' in UnityExplorer.",
|
"The default maximum number of elements per 'page' in UnityExplorer.",
|
||||||
25);
|
25);
|
||||||
|
@ -7,6 +7,7 @@ using BF = System.Reflection.BindingFlags;
|
|||||||
using UnityExplorer.Core.Config;
|
using UnityExplorer.Core.Config;
|
||||||
using UnityExplorer.Core;
|
using UnityExplorer.Core;
|
||||||
using UnityExplorer.UI;
|
using UnityExplorer.UI;
|
||||||
|
using System.Collections;
|
||||||
#if ML
|
#if ML
|
||||||
using Harmony;
|
using Harmony;
|
||||||
#else
|
#else
|
||||||
@ -48,6 +49,34 @@ namespace UnityExplorer.Core.Input
|
|||||||
|
|
||||||
Unlock = ConfigManager.Force_Unlock_Mouse.Value;
|
Unlock = ConfigManager.Force_Unlock_Mouse.Value;
|
||||||
ConfigManager.Force_Unlock_Mouse.OnValueChanged += (bool val) => { Unlock = val; };
|
ConfigManager.Force_Unlock_Mouse.OnValueChanged += (bool val) => { Unlock = val; };
|
||||||
|
|
||||||
|
if (ConfigManager.Aggressive_Force_Unlock.Value)
|
||||||
|
SetupAggressiveUnlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetupAggressiveUnlock()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
RuntimeProvider.Instance.StartCoroutine(AggressiveUnlockCoroutine());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
ExplorerCore.LogWarning($"Exception setting up Aggressive Mouse Unlock: {ex}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static readonly WaitForEndOfFrame _waitForEndOfFrame = new WaitForEndOfFrame();
|
||||||
|
|
||||||
|
private static IEnumerator AggressiveUnlockCoroutine()
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
yield return _waitForEndOfFrame;
|
||||||
|
|
||||||
|
if (UIManager.ShowMenu)
|
||||||
|
UpdateCursorControl();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void UpdateCursorControl()
|
public static void UpdateCursorControl()
|
||||||
|
@ -14,7 +14,7 @@ namespace UnityExplorer
|
|||||||
public class ExplorerCore
|
public class ExplorerCore
|
||||||
{
|
{
|
||||||
public const string NAME = "UnityExplorer";
|
public const string NAME = "UnityExplorer";
|
||||||
public const string VERSION = "3.3.12";
|
public const string VERSION = "3.3.15";
|
||||||
public const string AUTHOR = "Sinai";
|
public const string AUTHOR = "Sinai";
|
||||||
public const string GUID = "com.sinai.unityexplorer";
|
public const string GUID = "com.sinai.unityexplorer";
|
||||||
|
|
||||||
|
@ -199,23 +199,10 @@ The following helper methods are available:
|
|||||||
InputField.onValueChanged.AddListener((string s) => { OnInputChanged(s); });
|
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()
|
public void UpdateConsole()
|
||||||
{
|
{
|
||||||
if (s_copyPasteBuffer != null)
|
if (Time.time > s_timeOfLastInternalSet)
|
||||||
{
|
Writing = false;
|
||||||
if (!IsUserCopyPasting())
|
|
||||||
{
|
|
||||||
OnInputChanged(s_copyPasteBuffer);
|
|
||||||
|
|
||||||
s_copyPasteBuffer = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (EnableCtrlRShortcut)
|
if (EnableCtrlRShortcut)
|
||||||
{
|
{
|
||||||
@ -274,6 +261,8 @@ The following helper methods are available:
|
|||||||
|
|
||||||
public void UseAutocomplete(string suggestion)
|
public void UseAutocomplete(string suggestion)
|
||||||
{
|
{
|
||||||
|
Writing = true;
|
||||||
|
|
||||||
string input = InputField.text;
|
string input = InputField.text;
|
||||||
input = input.Insert(m_lastCaretPos, suggestion);
|
input = input.Insert(m_lastCaretPos, suggestion);
|
||||||
InputField.text = input;
|
InputField.text = input;
|
||||||
@ -288,20 +277,32 @@ The following helper methods are available:
|
|||||||
AutoCompleter.ClearAutocompletes();
|
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)
|
public void OnInputChanged(string newText, bool forceUpdate = false)
|
||||||
{
|
{
|
||||||
if (IsUserCopyPasting())
|
if (!Writing && Time.time <= s_timeOfLastUpdate)
|
||||||
{
|
|
||||||
//Console.WriteLine("Copy+Paste detected!");
|
|
||||||
s_copyPasteBuffer = newText;
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
s_timeOfLastUpdate = Time.time;
|
||||||
|
|
||||||
if (EnableAutoIndent)
|
if (EnableAutoIndent)
|
||||||
UpdateIndent(newText);
|
UpdateIndent(newText);
|
||||||
|
|
||||||
|
Writing = true;
|
||||||
|
|
||||||
if (!forceUpdate && string.IsNullOrEmpty(newText))
|
if (!forceUpdate && string.IsNullOrEmpty(newText))
|
||||||
inputHighlightText.text = string.Empty;
|
inputHighlightText.text = string.Empty;
|
||||||
else
|
else
|
||||||
@ -378,6 +379,8 @@ The following helper methods are available:
|
|||||||
|
|
||||||
private void AutoIndentCaret()
|
private void AutoIndentCaret()
|
||||||
{
|
{
|
||||||
|
Writing = true;
|
||||||
|
|
||||||
if (CurrentIndent > 0)
|
if (CurrentIndent > 0)
|
||||||
{
|
{
|
||||||
string indent = GetAutoIndentTab(CurrentIndent);
|
string indent = GetAutoIndentTab(CurrentIndent);
|
||||||
|
Reference in New Issue
Block a user