mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-16 14:17:51 +08:00
Add option to hide NativeInfoPtrs
NativeMethodInfoPtr and NativeFieldInfoPtr create a lot of clutter in the class inspector, so I added an option to filter them out.
This commit is contained in:
parent
264c84b3ba
commit
23715d44a8
@ -27,6 +27,7 @@ namespace UnityExplorer.Config
|
|||||||
public static ConfigElement<KeyCode> UI_MouseInspect_Keybind;
|
public static ConfigElement<KeyCode> UI_MouseInspect_Keybind;
|
||||||
public static ConfigElement<string> CSConsole_Assembly_Blacklist;
|
public static ConfigElement<string> CSConsole_Assembly_Blacklist;
|
||||||
public static ConfigElement<string> Reflection_Signature_Blacklist;
|
public static ConfigElement<string> Reflection_Signature_Blacklist;
|
||||||
|
public static ConfigElement<bool> Reflection_Hide_NativeInfoPtrs;
|
||||||
|
|
||||||
// internal configs
|
// internal configs
|
||||||
internal static InternalConfigHandler InternalHandler { get; private set; }
|
internal static InternalConfigHandler InternalHandler { get; private set; }
|
||||||
@ -139,6 +140,11 @@ namespace UnityExplorer.Config
|
|||||||
"Seperate signatures with a semicolon ';'.\r\n" +
|
"Seperate signatures with a semicolon ';'.\r\n" +
|
||||||
"For example, to blacklist Camera.main, you would add 'UnityEngine.Camera.main;'",
|
"For example, to blacklist Camera.main, you would add 'UnityEngine.Camera.main;'",
|
||||||
"");
|
"");
|
||||||
|
|
||||||
|
Reflection_Hide_NativeInfoPtrs = new("Hide NativeMethodInfoPtr_s and NativeFieldInfoPtr_s",
|
||||||
|
"Use this to blacklist NativeMethodPtr_s and NativeFieldInfoPtrs_s from the class inspector, mainly to reduce clutter.\r\n" +
|
||||||
|
"For example, this will hide 'Class.NativeFieldInfoPtr_value' for the field 'Class.value'.",
|
||||||
|
false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,6 +70,13 @@ namespace UnityExplorer.Runtime
|
|||||||
|
|
||||||
public static bool IsBlacklisted(MemberInfo member)
|
public static bool IsBlacklisted(MemberInfo member)
|
||||||
{
|
{
|
||||||
|
if (ConfigManager.Reflection_Hide_NativeInfoPtrs.Value)
|
||||||
|
{
|
||||||
|
bool isNativeInfoPtr = member.Name.StartsWith("NativeFieldInfoPtr_") || member.Name.StartsWith("NativeMethodInfoPtr_");
|
||||||
|
if (isNativeInfoPtr)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(member.DeclaringType?.Namespace))
|
if (string.IsNullOrEmpty(member.DeclaringType?.Namespace))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user