mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-16 00:07:52 +08:00
Progress on ReflectionInspector, framework mostly done
This commit is contained in:
@ -20,7 +20,6 @@ namespace UnityExplorer.Core.Config
|
||||
public static ConfigElement<bool> Force_Unlock_Mouse;
|
||||
public static ConfigElement<KeyCode> Force_Unlock_Keybind;
|
||||
public static ConfigElement<bool> Aggressive_Force_Unlock;
|
||||
//public static ConfigElement<MenuPages> Default_Tab;
|
||||
public static ConfigElement<int> Default_Page_Limit;
|
||||
public static ConfigElement<string> Default_Output_Path;
|
||||
public static ConfigElement<bool> Log_Unity_Debug;
|
||||
@ -84,7 +83,7 @@ namespace UnityExplorer.Core.Config
|
||||
|
||||
Force_Unlock_Keybind = new ConfigElement<KeyCode>("Force Unlock Keybind",
|
||||
"The keybind to toggle the 'Force Unlock Mouse' setting. Only usable when UnityExplorer is open.",
|
||||
KeyCode.F6);
|
||||
KeyCode.None);
|
||||
|
||||
Aggressive_Force_Unlock = new ConfigElement<bool>("Aggressive Mouse Unlock",
|
||||
"Use Camera.onPostRender callback to aggressively force the Mouse to be unlocked (requires game restart).",
|
||||
|
@ -20,8 +20,19 @@ namespace UnityExplorer.Core.Input
|
||||
|
||||
public static Vector3 MousePosition => m_inputModule.MousePosition;
|
||||
|
||||
public static bool GetKeyDown(KeyCode key) => m_inputModule.GetKeyDown(key);
|
||||
public static bool GetKey(KeyCode key) => m_inputModule.GetKey(key);
|
||||
public static bool GetKeyDown(KeyCode key)
|
||||
{
|
||||
if (key == KeyCode.None)
|
||||
return false;
|
||||
return m_inputModule.GetKeyDown(key);
|
||||
}
|
||||
|
||||
public static bool GetKey(KeyCode key)
|
||||
{
|
||||
if (key == KeyCode.None)
|
||||
return false;
|
||||
return m_inputModule.GetKey(key);
|
||||
}
|
||||
|
||||
public static bool GetMouseButtonDown(int btn) => m_inputModule.GetMouseButtonDown(btn);
|
||||
public static bool GetMouseButton(int btn) => m_inputModule.GetMouseButton(btn);
|
||||
|
@ -69,7 +69,8 @@ namespace UnityExplorer
|
||||
/// <param name="t">The Type to check</param>
|
||||
/// <returns>True if the Type is assignable to IEnumerable, otherwise false.</returns>
|
||||
public static bool IsEnumerable(this Type t)
|
||||
=> ReflectionProvider.Instance.IsAssignableFrom(typeof(IEnumerable), t);
|
||||
=> !typeof(UnityEngine.Transform).IsAssignableFrom(t)
|
||||
&& ReflectionProvider.Instance.IsAssignableFrom(typeof(IEnumerable), t);
|
||||
|
||||
/// <summary>
|
||||
/// Check if the provided Type is assignable to IDictionary.
|
||||
|
@ -7,15 +7,16 @@ namespace UnityExplorer.Tests
|
||||
{
|
||||
public static class TestClass
|
||||
{
|
||||
static TestClass()
|
||||
{
|
||||
List = new List<string>();
|
||||
for (int i = 0; i < 10000; i++)
|
||||
List.Add(i.ToString());
|
||||
}
|
||||
|
||||
public static List<string> List;
|
||||
|
||||
public const int ConstantInt = 5;
|
||||
|
||||
public static string LongString = @"#######################################################################################################
|
||||
###############################################################################################################################
|
||||
#####################################################################################################################################
|
||||
#########################################################################################################################
|
||||
######################################################################################################";
|
||||
|
||||
#if CPP
|
||||
public static string testStringOne = "Test";
|
||||
public static Il2CppSystem.Object testStringTwo = "string boxed as cpp object";
|
||||
@ -24,9 +25,15 @@ namespace UnityExplorer.Tests
|
||||
|
||||
public static Il2CppSystem.Collections.Hashtable testHashset;
|
||||
public static Il2CppSystem.Collections.Generic.List<Il2CppSystem.Object> testList;
|
||||
#endif
|
||||
|
||||
static TestClass()
|
||||
{
|
||||
List = new List<string>();
|
||||
for (int i = 0; i < 10000; i++)
|
||||
List.Add(i.ToString());
|
||||
|
||||
#if CPP
|
||||
testHashset = new Il2CppSystem.Collections.Hashtable();
|
||||
testHashset.Add("key1", "itemOne");
|
||||
testHashset.Add("key2", "itemTwo");
|
||||
@ -36,8 +43,7 @@ namespace UnityExplorer.Tests
|
||||
testList.Add("One");
|
||||
testList.Add("Two");
|
||||
testList.Add("Three");
|
||||
//testIList = list.TryCast<Il2CppSystem.Collections.IList>();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user