mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-15 13:57:31 +08:00
3.3.5 - fix Il2Cpp Hashtable, boxed strings
This commit is contained in:
parent
7443f6500e
commit
113f2fd922
@ -7,6 +7,7 @@ using System.Linq;
|
|||||||
using UnityExplorer.Core.Runtime;
|
using UnityExplorer.Core.Runtime;
|
||||||
using UnityExplorer.UI.Main.CSConsole;
|
using UnityExplorer.UI.Main.CSConsole;
|
||||||
using UnityExplorer.UI.Main.Home;
|
using UnityExplorer.UI.Main.Home;
|
||||||
|
using UnityExplorer.UI.Inspectors;
|
||||||
|
|
||||||
namespace UnityExplorer.Core.CSharp
|
namespace UnityExplorer.Core.CSharp
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@ using System.Reflection;
|
|||||||
using BF = System.Reflection.BindingFlags;
|
using BF = System.Reflection.BindingFlags;
|
||||||
using UnityExplorer.Core.Runtime;
|
using UnityExplorer.Core.Runtime;
|
||||||
|
|
||||||
namespace UnityExplorer.Core
|
namespace UnityExplorer
|
||||||
{
|
{
|
||||||
public static class ReflectionUtility
|
public static class ReflectionUtility
|
||||||
{
|
{
|
||||||
@ -18,7 +18,7 @@ namespace UnityExplorer.Core
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="obj">The object to get the true Type for.</param>
|
/// <param name="obj">The object to get the true Type for.</param>
|
||||||
/// <returns>The most accurate Type of the object which could be identified.</returns>
|
/// <returns>The most accurate Type of the object which could be identified.</returns>
|
||||||
public static Type GetType(this object obj)
|
public static Type GetActualType(this object obj)
|
||||||
{
|
{
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
return null;
|
return null;
|
||||||
@ -32,7 +32,7 @@ namespace UnityExplorer.Core
|
|||||||
/// <param name="obj">The object to cast</param>
|
/// <param name="obj">The object to cast</param>
|
||||||
/// <returns>The object, cast to the underlying Type if possible, otherwise the original object.</returns>
|
/// <returns>The object, cast to the underlying Type if possible, otherwise the original object.</returns>
|
||||||
public static object Cast(this object obj)
|
public static object Cast(this object obj)
|
||||||
=> ReflectionProvider.Instance.Cast(obj, GetType(obj));
|
=> ReflectionProvider.Instance.Cast(obj, GetActualType(obj));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Cast an object to a Type, if possible.
|
/// Cast an object to a Type, if possible.
|
||||||
@ -105,7 +105,7 @@ namespace UnityExplorer.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get all base types of the provided Type, including itself.
|
/// Get all base types of the provided Type, including itself.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static Type[] GetAllBaseTypes(this object obj) => GetAllBaseTypes(GetType(obj));
|
public static Type[] GetAllBaseTypes(this object obj) => GetAllBaseTypes(GetActualType(obj));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get all base types of the provided Type, including itself.
|
/// Get all base types of the provided Type, including itself.
|
||||||
|
@ -163,7 +163,7 @@ namespace UnityExplorer.Core.Runtime.Il2Cpp
|
|||||||
IntPtr castFromPtr = il2cpp_object_get_class(ilObj.Pointer);
|
IntPtr castFromPtr = il2cpp_object_get_class(ilObj.Pointer);
|
||||||
|
|
||||||
if (!il2cpp_class_is_assignable_from(castToPtr, castFromPtr))
|
if (!il2cpp_class_is_assignable_from(castToPtr, castFromPtr))
|
||||||
return obj;
|
return null;
|
||||||
|
|
||||||
if (RuntimeSpecificsStore.IsInjected(castToPtr))
|
if (RuntimeSpecificsStore.IsInjected(castToPtr))
|
||||||
return UnhollowerBaseLib.Runtime.ClassInjectorBase.GetMonoObjectFromIl2CppPointer(ilObj.Pointer);
|
return UnhollowerBaseLib.Runtime.ClassInjectorBase.GetMonoObjectFromIl2CppPointer(ilObj.Pointer);
|
||||||
|
22
src/Core/TestClass.cs
Normal file
22
src/Core/TestClass.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace UnityExplorer
|
||||||
|
{
|
||||||
|
#if CPP
|
||||||
|
public static class TestClass
|
||||||
|
{
|
||||||
|
public static Il2CppSystem.Collections.Hashtable testHashset;
|
||||||
|
|
||||||
|
static TestClass()
|
||||||
|
{
|
||||||
|
testHashset = new Il2CppSystem.Collections.Hashtable();
|
||||||
|
testHashset.Add("key1", "itemOne");
|
||||||
|
testHashset.Add("key2", "itemTwo");
|
||||||
|
testHashset.Add("key3", "itemThree");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
@ -12,7 +12,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.4";
|
public const string VERSION = "3.3.5";
|
||||||
public const string AUTHOR = "Sinai";
|
public const string AUTHOR = "Sinai";
|
||||||
public const string GUID = "com.sinai.unityexplorer";
|
public const string GUID = "com.sinai.unityexplorer";
|
||||||
|
|
||||||
@ -46,6 +46,8 @@ namespace UnityExplorer
|
|||||||
UIManager.Init();
|
UIManager.Init();
|
||||||
|
|
||||||
Log($"{NAME} {VERSION} initialized.");
|
Log($"{NAME} {VERSION} initialized.");
|
||||||
|
|
||||||
|
// InspectorManager.Instance.Inspect(typeof(TestClass));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Update()
|
public static void Update()
|
||||||
|
@ -21,7 +21,11 @@ namespace UnityExplorer.Loader.ML
|
|||||||
{
|
{
|
||||||
prefCategory = MelonPreferences.CreateCategory(CTG_NAME, $"{CTG_NAME} Settings");
|
prefCategory = MelonPreferences.CreateCategory(CTG_NAME, $"{CTG_NAME} Settings");
|
||||||
|
|
||||||
MelonPreferences.Mapper.RegisterMapper(KeycodeReader, KeycodeWriter);
|
try
|
||||||
|
{
|
||||||
|
MelonPreferences.Mapper.RegisterMapper(KeycodeReader, KeycodeWriter);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void LoadConfig()
|
public override void LoadConfig()
|
||||||
|
@ -10,7 +10,7 @@ using UnityExplorer.Core.Runtime;
|
|||||||
using UnityExplorer.Core;
|
using UnityExplorer.Core;
|
||||||
using UnityExplorer.UI.Utility;
|
using UnityExplorer.UI.Utility;
|
||||||
using UnityExplorer.UI.InteractiveValues;
|
using UnityExplorer.UI.InteractiveValues;
|
||||||
using UnityExplorer.UI.Main.Home.Inspectors.Reflection;
|
using UnityExplorer.UI.Inspectors.Reflection;
|
||||||
|
|
||||||
namespace UnityExplorer.UI.CacheObject
|
namespace UnityExplorer.UI.CacheObject
|
||||||
{
|
{
|
||||||
@ -86,7 +86,7 @@ namespace UnityExplorer.UI.CacheObject
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Type baseType = ReflectionUtility.GetType(IValue.Value) ?? FallbackType;
|
Type baseType = ReflectionUtility.GetActualType(IValue.Value) ?? FallbackType;
|
||||||
|
|
||||||
if (!ReflectionProvider.Instance.IsReflectionSupported(baseType))
|
if (!ReflectionProvider.Instance.IsReflectionSupported(baseType))
|
||||||
throw new Exception("Type not supported with reflection");
|
throw new Exception("Type not supported with reflection");
|
||||||
@ -94,7 +94,7 @@ namespace UnityExplorer.UI.CacheObject
|
|||||||
UpdateReflection();
|
UpdateReflection();
|
||||||
|
|
||||||
if (IValue.Value != null)
|
if (IValue.Value != null)
|
||||||
IValue.Value = IValue.Value.Cast(ReflectionUtility.GetType(IValue.Value));
|
IValue.Value = IValue.Value.Cast(ReflectionUtility.GetActualType(IValue.Value));
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -55,7 +55,7 @@ namespace UnityExplorer.UI.CacheObject
|
|||||||
// if the type has changed fundamentally, make a new interactivevalue for it
|
// if the type has changed fundamentally, make a new interactivevalue for it
|
||||||
var type = value == null
|
var type = value == null
|
||||||
? FallbackType
|
? FallbackType
|
||||||
: ReflectionUtility.GetType(value);
|
: ReflectionUtility.GetActualType(value);
|
||||||
|
|
||||||
var ivalueType = InteractiveValue.GetIValueForType(type);
|
var ivalueType = InteractiveValue.GetIValueForType(type);
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ using UnityEngine.UI;
|
|||||||
using UnityExplorer.Core.Runtime;
|
using UnityExplorer.Core.Runtime;
|
||||||
using UnityExplorer.UI.Utility;
|
using UnityExplorer.UI.Utility;
|
||||||
|
|
||||||
namespace UnityExplorer.UI.Main.Home.Inspectors.GameObjects
|
namespace UnityExplorer.UI.Inspectors.GameObjects
|
||||||
{
|
{
|
||||||
public class ChildList
|
public class ChildList
|
||||||
{
|
{
|
@ -8,7 +8,7 @@ using UnityExplorer.Core;
|
|||||||
using UnityExplorer.Core.Runtime;
|
using UnityExplorer.Core.Runtime;
|
||||||
using UnityExplorer.UI.Utility;
|
using UnityExplorer.UI.Utility;
|
||||||
|
|
||||||
namespace UnityExplorer.UI.Main.Home.Inspectors.GameObjects
|
namespace UnityExplorer.UI.Inspectors.GameObjects
|
||||||
{
|
{
|
||||||
public class ComponentList
|
public class ComponentList
|
||||||
{
|
{
|
||||||
@ -75,7 +75,7 @@ namespace UnityExplorer.UI.Main.Home.Inspectors.GameObjects
|
|||||||
|
|
||||||
var text = s_compListTexts[i];
|
var text = s_compListTexts[i];
|
||||||
|
|
||||||
text.text = SignatureHighlighter.ParseFullSyntax(ReflectionUtility.GetType(comp), true);
|
text.text = SignatureHighlighter.ParseFullSyntax(ReflectionUtility.GetActualType(comp), true);
|
||||||
|
|
||||||
var toggle = s_compToggles[i];
|
var toggle = s_compToggles[i];
|
||||||
#if CPP
|
#if CPP
|
@ -8,7 +8,7 @@ using UnityExplorer.Core.Input;
|
|||||||
using UnityExplorer.Core.Runtime;
|
using UnityExplorer.Core.Runtime;
|
||||||
using UnityExplorer.Core.Unity;
|
using UnityExplorer.Core.Unity;
|
||||||
|
|
||||||
namespace UnityExplorer.UI.Main.Home.Inspectors.GameObjects
|
namespace UnityExplorer.UI.Inspectors.GameObjects
|
||||||
{
|
{
|
||||||
public class GameObjectControls
|
public class GameObjectControls
|
||||||
{
|
{
|
@ -7,7 +7,7 @@ using UnityEngine.UI;
|
|||||||
using UnityExplorer.Core.Runtime;
|
using UnityExplorer.Core.Runtime;
|
||||||
using UnityExplorer.Core.Unity;
|
using UnityExplorer.Core.Unity;
|
||||||
|
|
||||||
namespace UnityExplorer.UI.Main.Home.Inspectors.GameObjects
|
namespace UnityExplorer.UI.Inspectors.GameObjects
|
||||||
{
|
{
|
||||||
public class GameObjectInspector : InspectorBase
|
public class GameObjectInspector : InspectorBase
|
||||||
{
|
{
|
@ -11,6 +11,7 @@ using UnityExplorer.Core.Input;
|
|||||||
using UnityExplorer.Core.Runtime;
|
using UnityExplorer.Core.Runtime;
|
||||||
using UnityExplorer.UI;
|
using UnityExplorer.UI;
|
||||||
using UnityExplorer.UI.Main;
|
using UnityExplorer.UI.Main;
|
||||||
|
using UnityExplorer.UI.Inspectors;
|
||||||
|
|
||||||
namespace UnityExplorer.UI.Main.Home
|
namespace UnityExplorer.UI.Main.Home
|
||||||
{
|
{
|
@ -3,7 +3,7 @@ using UnityEngine;
|
|||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using UnityExplorer.Core.Unity;
|
using UnityExplorer.Core.Unity;
|
||||||
|
|
||||||
namespace UnityExplorer.UI.Main.Home.Inspectors
|
namespace UnityExplorer.UI.Inspectors
|
||||||
{
|
{
|
||||||
public abstract class InspectorBase
|
public abstract class InspectorBase
|
||||||
{
|
{
|
@ -9,12 +9,11 @@ using UnityEngine.SceneManagement;
|
|||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using UnityExplorer.Core.Runtime;
|
using UnityExplorer.Core.Runtime;
|
||||||
using UnityExplorer.UI.Main.Home;
|
using UnityExplorer.UI.Main.Home;
|
||||||
using UnityExplorer.UI.Main.Home.Inspectors;
|
|
||||||
using UnityExplorer.UI.CacheObject;
|
using UnityExplorer.UI.CacheObject;
|
||||||
using UnityExplorer.UI.Main.Home.Inspectors.GameObjects;
|
using UnityExplorer.UI.Inspectors.GameObjects;
|
||||||
using UnityExplorer.UI.Main.Home.Inspectors.Reflection;
|
using UnityExplorer.UI.Inspectors.Reflection;
|
||||||
|
|
||||||
namespace UnityExplorer.UI.Main.Home
|
namespace UnityExplorer.UI.Inspectors
|
||||||
{
|
{
|
||||||
public class InspectorManager
|
public class InspectorManager
|
||||||
{
|
{
|
@ -9,7 +9,7 @@ using UnityExplorer.Core;
|
|||||||
using UnityExplorer.Core.Config;
|
using UnityExplorer.Core.Config;
|
||||||
using UnityExplorer.Core.Runtime;
|
using UnityExplorer.Core.Runtime;
|
||||||
|
|
||||||
namespace UnityExplorer.UI.Main.Home.Inspectors.Reflection
|
namespace UnityExplorer.UI.Inspectors.Reflection
|
||||||
{
|
{
|
||||||
public enum MemberScopes
|
public enum MemberScopes
|
||||||
{
|
{
|
@ -9,9 +9,11 @@ using UnityExplorer.Core;
|
|||||||
using UnityExplorer.Core.Config;
|
using UnityExplorer.Core.Config;
|
||||||
using UnityExplorer.Core.Runtime;
|
using UnityExplorer.Core.Runtime;
|
||||||
using UnityExplorer.UI.CacheObject;
|
using UnityExplorer.UI.CacheObject;
|
||||||
|
using UnityExplorer.UI.Main;
|
||||||
|
using UnityExplorer.UI.Main.Home;
|
||||||
using UnityExplorer.UI.Utility;
|
using UnityExplorer.UI.Utility;
|
||||||
|
|
||||||
namespace UnityExplorer.UI.Main.Home.Inspectors.Reflection
|
namespace UnityExplorer.UI.Inspectors.Reflection
|
||||||
{
|
{
|
||||||
public class ReflectionInspector : InspectorBase
|
public class ReflectionInspector : InspectorBase
|
||||||
{
|
{
|
||||||
@ -78,7 +80,7 @@ namespace UnityExplorer.UI.Main.Home.Inspectors.Reflection
|
|||||||
if (this is StaticInspector)
|
if (this is StaticInspector)
|
||||||
m_targetType = target as Type;
|
m_targetType = target as Type;
|
||||||
else
|
else
|
||||||
m_targetType = ReflectionUtility.GetType(target);
|
m_targetType = ReflectionUtility.GetActualType(target);
|
||||||
|
|
||||||
m_targetTypeShortName = SignatureHighlighter.ParseFullSyntax(m_targetType, false);
|
m_targetTypeShortName = SignatureHighlighter.ParseFullSyntax(m_targetType, false);
|
||||||
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace UnityExplorer.UI.Main.Home.Inspectors.Reflection
|
namespace UnityExplorer.UI.Inspectors.Reflection
|
||||||
{
|
{
|
||||||
public class StaticInspector : ReflectionInspector
|
public class StaticInspector : ReflectionInspector
|
||||||
{
|
{
|
@ -218,32 +218,37 @@ namespace UnityExplorer.UI.InteractiveValues
|
|||||||
|
|
||||||
private IDictionary EnumerateWithReflection()
|
private IDictionary EnumerateWithReflection()
|
||||||
{
|
{
|
||||||
var valueType = ReflectionUtility.GetType(Value);
|
var valueType = ReflectionUtility.GetActualType(Value);
|
||||||
|
|
||||||
// get keys and values
|
|
||||||
var keys = valueType.GetProperty("Keys").GetValue(Value, null);
|
|
||||||
var values = valueType.GetProperty("Values").GetValue(Value, null);
|
|
||||||
|
|
||||||
// create lists to hold them
|
|
||||||
var keyList = new List<object>();
|
var keyList = new List<object>();
|
||||||
var valueList = new List<object>();
|
var valueList = new List<object>();
|
||||||
|
|
||||||
// store entries with reflection
|
var hashtable = Value.Cast(typeof(Il2CppSystem.Collections.Hashtable)) as Il2CppSystem.Collections.Hashtable;
|
||||||
EnumerateCollection(keys, keyList);
|
|
||||||
EnumerateCollection(values, valueList);
|
|
||||||
|
|
||||||
// make actual mono dictionary
|
if (hashtable != null)
|
||||||
var dict = (IDictionary)Activator.CreateInstance(typeof(Dictionary<,>)
|
{
|
||||||
.MakeGenericType(m_typeOfKeys, m_typeofValues));
|
EnumerateCppHashtable(hashtable, keyList, valueList);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var keys = valueType.GetProperty("Keys").GetValue(Value, null);
|
||||||
|
var values = valueType.GetProperty("Values").GetValue(Value, null);
|
||||||
|
|
||||||
|
EnumerateCppIDictionary(keys, keyList);
|
||||||
|
EnumerateCppIDictionary(values, valueList);
|
||||||
|
}
|
||||||
|
|
||||||
|
var dict = Activator.CreateInstance(typeof(Dictionary<,>)
|
||||||
|
.MakeGenericType(m_typeOfKeys, m_typeofValues))
|
||||||
|
as IDictionary;
|
||||||
|
|
||||||
// finally iterate into mono dictionary
|
|
||||||
for (int i = 0; i < keyList.Count; i++)
|
for (int i = 0; i < keyList.Count; i++)
|
||||||
dict.Add(keyList[i], valueList[i]);
|
dict.Add(keyList[i], valueList[i]);
|
||||||
|
|
||||||
return dict;
|
return dict;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EnumerateCollection(object collection, List<object> list)
|
private void EnumerateCppIDictionary(object collection, List<object> list)
|
||||||
{
|
{
|
||||||
// invoke GetEnumerator
|
// invoke GetEnumerator
|
||||||
var enumerator = collection.GetType().GetMethod("GetEnumerator").Invoke(collection, null);
|
var enumerator = collection.GetType().GetMethod("GetEnumerator").Invoke(collection, null);
|
||||||
@ -258,11 +263,23 @@ namespace UnityExplorer.UI.InteractiveValues
|
|||||||
list.Add(current.GetValue(enumerator, null));
|
list.Add(current.GetValue(enumerator, null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void EnumerateCppHashtable(Il2CppSystem.Collections.Hashtable hashtable, List<object> keys, List<object> values)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < hashtable.buckets.Count; i++)
|
||||||
|
{
|
||||||
|
var bucket = hashtable.buckets[i];
|
||||||
|
if (bucket == null || bucket.key == null)
|
||||||
|
continue;
|
||||||
|
keys.Add(bucket.key);
|
||||||
|
values.Add(bucket.val);
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region UI CONSTRUCTION
|
#region UI CONSTRUCTION
|
||||||
|
|
||||||
internal GameObject m_listContent;
|
internal GameObject m_listContent;
|
||||||
internal LayoutElement m_listLayout;
|
internal LayoutElement m_listLayout;
|
||||||
|
@ -6,6 +6,7 @@ using System.Reflection;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
using UnityExplorer.Core;
|
||||||
using UnityExplorer.Core.Config;
|
using UnityExplorer.Core.Config;
|
||||||
using UnityExplorer.Core.Unity;
|
using UnityExplorer.Core.Unity;
|
||||||
using UnityExplorer.UI;
|
using UnityExplorer.UI;
|
||||||
@ -38,11 +39,11 @@ namespace UnityExplorer.UI.InteractiveValues
|
|||||||
|
|
||||||
internal IEnumerable RefIEnumerable;
|
internal IEnumerable RefIEnumerable;
|
||||||
internal IList RefIList;
|
internal IList RefIList;
|
||||||
#if CPP
|
//#if CPP
|
||||||
internal Il2CppSystem.Collections.ICollection CppICollection;
|
// internal object CppICollection;
|
||||||
#else
|
//#else
|
||||||
internal ICollection CppICollection = null;
|
// internal object CppICollection = null;
|
||||||
#endif
|
//#endif
|
||||||
|
|
||||||
internal readonly Type m_baseEntryType;
|
internal readonly Type m_baseEntryType;
|
||||||
|
|
||||||
@ -55,13 +56,17 @@ namespace UnityExplorer.UI.InteractiveValues
|
|||||||
RefIEnumerable = Value as IEnumerable;
|
RefIEnumerable = Value as IEnumerable;
|
||||||
RefIList = Value as IList;
|
RefIList = Value as IList;
|
||||||
|
|
||||||
#if CPP
|
//#if CPP
|
||||||
if (Value != null && RefIList == null)
|
// if (Value != null && RefIList == null)
|
||||||
{
|
// {
|
||||||
try { CppICollection = (Value as Il2CppSystem.Object).TryCast<Il2CppSystem.Collections.ICollection>(); }
|
// try
|
||||||
catch { }
|
// {
|
||||||
}
|
// var type = typeof(Il2CppSystem.Collections.ICollection).MakeGenericType(this.m_baseEntryType);
|
||||||
#endif
|
// CppICollection = (Value as Il2CppSystem.Object).Cast(type);
|
||||||
|
// }
|
||||||
|
// catch { }
|
||||||
|
// }
|
||||||
|
//#endif
|
||||||
|
|
||||||
if (m_subContentParent.activeSelf)
|
if (m_subContentParent.activeSelf)
|
||||||
{
|
{
|
||||||
@ -91,8 +96,8 @@ namespace UnityExplorer.UI.InteractiveValues
|
|||||||
if (Value != null)
|
if (Value != null)
|
||||||
{
|
{
|
||||||
string count = "?";
|
string count = "?";
|
||||||
if (m_recacheWanted && (RefIList != null || CppICollection != null))
|
if (m_recacheWanted && RefIList != null)// || CppICollection != null))
|
||||||
count = RefIList?.Count.ToString() ?? CppICollection.Count.ToString();
|
count = RefIList.Count.ToString();// ?? CppICollection.Count.ToString();
|
||||||
else if (!m_recacheWanted)
|
else if (!m_recacheWanted)
|
||||||
count = m_entries.Count.ToString();
|
count = m_entries.Count.ToString();
|
||||||
|
|
||||||
|
@ -23,6 +23,14 @@ namespace UnityExplorer.UI.InteractiveValues
|
|||||||
|
|
||||||
public override void OnValueUpdated()
|
public override void OnValueUpdated()
|
||||||
{
|
{
|
||||||
|
#if CPP
|
||||||
|
// strings boxed as Il2CppSystem.Objects can behave weirdly.
|
||||||
|
// GetActualType will find they are a string, but if its boxed
|
||||||
|
// then we need to unbox it like this...
|
||||||
|
if (!(Value is string))
|
||||||
|
Value = ((Il2CppSystem.Object)Value).ToString();
|
||||||
|
#endif
|
||||||
|
|
||||||
base.OnValueUpdated();
|
base.OnValueUpdated();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ using UnityExplorer.UI;
|
|||||||
using UnityExplorer.UI.Utility;
|
using UnityExplorer.UI.Utility;
|
||||||
using UnityExplorer.UI.CacheObject;
|
using UnityExplorer.UI.CacheObject;
|
||||||
using UnityExplorer.UI.Main.Home;
|
using UnityExplorer.UI.Main.Home;
|
||||||
|
using UnityExplorer.UI.Inspectors;
|
||||||
|
|
||||||
namespace UnityExplorer.UI.InteractiveValues
|
namespace UnityExplorer.UI.InteractiveValues
|
||||||
{
|
{
|
||||||
@ -66,7 +67,7 @@ namespace UnityExplorer.UI.InteractiveValues
|
|||||||
|
|
||||||
public static InteractiveValue Create(object value, Type fallbackType)
|
public static InteractiveValue Create(object value, Type fallbackType)
|
||||||
{
|
{
|
||||||
var type = ReflectionUtility.GetType(value) ?? fallbackType;
|
var type = ReflectionUtility.GetActualType(value) ?? fallbackType;
|
||||||
var iType = GetIValueForType(type);
|
var iType = GetIValueForType(type);
|
||||||
|
|
||||||
return (InteractiveValue)Activator.CreateInstance(iType, new object[] { value, type });
|
return (InteractiveValue)Activator.CreateInstance(iType, new object[] { value, type });
|
||||||
|
@ -217,7 +217,6 @@ namespace UnityExplorer.UI.Main
|
|||||||
{
|
{
|
||||||
LogUnity = val;
|
LogUnity = val;
|
||||||
ConfigManager.Log_Unity_Debug.Value = val;
|
ConfigManager.Log_Unity_Debug.Value = val;
|
||||||
ConfigManager.Handler.SaveConfig();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ConfigManager.Log_Unity_Debug.OnValueChanged += (bool val) => { unityToggle.isOn = val; };
|
ConfigManager.Log_Unity_Debug.OnValueChanged += (bool val) => { unityToggle.isOn = val; };
|
||||||
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
using UnityExplorer.UI.Inspectors;
|
||||||
|
|
||||||
namespace UnityExplorer.UI.Main.Home
|
namespace UnityExplorer.UI.Main.Home
|
||||||
{
|
{
|
||||||
|
@ -13,6 +13,7 @@ using UnityExplorer.UI.Utility;
|
|||||||
using UnityExplorer.UI.Main.Search;
|
using UnityExplorer.UI.Main.Search;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using UnityExplorer.Core;
|
using UnityExplorer.Core;
|
||||||
|
using UnityExplorer.UI.Inspectors;
|
||||||
|
|
||||||
namespace UnityExplorer.UI.Main.Home
|
namespace UnityExplorer.UI.Main.Home
|
||||||
{
|
{
|
||||||
|
@ -10,6 +10,7 @@ using UnityExplorer.Core;
|
|||||||
using UnityExplorer.UI.Utility;
|
using UnityExplorer.UI.Utility;
|
||||||
using UnityExplorer.Core.Search;
|
using UnityExplorer.Core.Search;
|
||||||
using UnityExplorer.UI.Main.Home;
|
using UnityExplorer.UI.Main.Home;
|
||||||
|
using UnityExplorer.UI.Inspectors;
|
||||||
|
|
||||||
namespace UnityExplorer.UI.Main.Search
|
namespace UnityExplorer.UI.Main.Search
|
||||||
{
|
{
|
||||||
@ -129,7 +130,7 @@ namespace UnityExplorer.UI.Main.Search
|
|||||||
|
|
||||||
if (m_context != SearchContext.StaticClass)
|
if (m_context != SearchContext.StaticClass)
|
||||||
{
|
{
|
||||||
var name = SignatureHighlighter.ParseFullSyntax(ReflectionUtility.GetType(obj), true);
|
var name = SignatureHighlighter.ParseFullSyntax(ReflectionUtility.GetActualType(obj), true);
|
||||||
|
|
||||||
if (unityObj && m_context != SearchContext.Singleton)
|
if (unityObj && m_context != SearchContext.Singleton)
|
||||||
{
|
{
|
||||||
|
@ -246,6 +246,7 @@
|
|||||||
<Compile Include="Core\Search\SceneFilter.cs" />
|
<Compile Include="Core\Search\SceneFilter.cs" />
|
||||||
<Compile Include="Core\Search\SearchContext.cs" />
|
<Compile Include="Core\Search\SearchContext.cs" />
|
||||||
<Compile Include="Core\Search\SearchProvider.cs" />
|
<Compile Include="Core\Search\SearchProvider.cs" />
|
||||||
|
<Compile Include="Core\TestClass.cs" />
|
||||||
<Compile Include="Core\Unity\UnityHelpers.cs" />
|
<Compile Include="Core\Unity\UnityHelpers.cs" />
|
||||||
<Compile Include="Loader\BIE\BepInExConfigHandler.cs" />
|
<Compile Include="Loader\BIE\BepInExConfigHandler.cs" />
|
||||||
<Compile Include="Loader\BIE\ExplorerBepInPlugin.cs" />
|
<Compile Include="Loader\BIE\ExplorerBepInPlugin.cs" />
|
||||||
@ -286,16 +287,16 @@
|
|||||||
<Compile Include="UI\Main\CSConsole\Lexer\SymbolMatch.cs" />
|
<Compile Include="UI\Main\CSConsole\Lexer\SymbolMatch.cs" />
|
||||||
<Compile Include="UI\Main\DebugConsole.cs" />
|
<Compile Include="UI\Main\DebugConsole.cs" />
|
||||||
<Compile Include="UI\Main\Home\HomePage.cs" />
|
<Compile Include="UI\Main\Home\HomePage.cs" />
|
||||||
<Compile Include="UI\Main\Home\InspectorManager.cs" />
|
<Compile Include="UI\Inspectors\InspectorManager.cs" />
|
||||||
<Compile Include="UI\Main\Home\Inspectors\GameObjects\ChildList.cs" />
|
<Compile Include="UI\Inspectors\GameObjects\ChildList.cs" />
|
||||||
<Compile Include="UI\Main\Home\Inspectors\GameObjects\ComponentList.cs" />
|
<Compile Include="UI\Inspectors\GameObjects\ComponentList.cs" />
|
||||||
<Compile Include="UI\Main\Home\Inspectors\GameObjects\GameObjectControls.cs" />
|
<Compile Include="UI\Inspectors\GameObjects\GameObjectControls.cs" />
|
||||||
<Compile Include="UI\Main\Home\Inspectors\GameObjects\GameObjectInspector.cs" />
|
<Compile Include="UI\Inspectors\GameObjects\GameObjectInspector.cs" />
|
||||||
<Compile Include="UI\Main\Home\Inspectors\InspectorBase.cs" />
|
<Compile Include="UI\Inspectors\InspectorBase.cs" />
|
||||||
<Compile Include="UI\Main\Home\Inspectors\Reflection\InstanceInspector.cs" />
|
<Compile Include="UI\Inspectors\Reflection\InstanceInspector.cs" />
|
||||||
<Compile Include="UI\Main\Home\Inspectors\Reflection\ReflectionInspector.cs" />
|
<Compile Include="UI\Inspectors\Reflection\ReflectionInspector.cs" />
|
||||||
<Compile Include="UI\Main\Home\Inspectors\Reflection\StaticInspector.cs" />
|
<Compile Include="UI\Inspectors\Reflection\StaticInspector.cs" />
|
||||||
<Compile Include="UI\Main\Home\InspectUnderMouse.cs" />
|
<Compile Include="UI\Inspectors\InspectUnderMouse.cs" />
|
||||||
<Compile Include="UI\Main\Home\SceneExplorer.cs" />
|
<Compile Include="UI\Main\Home\SceneExplorer.cs" />
|
||||||
<Compile Include="UI\Main\MainMenu.cs" />
|
<Compile Include="UI\Main\MainMenu.cs" />
|
||||||
<Compile Include="UI\Main\Options\OptionsPage.cs" />
|
<Compile Include="UI\Main\Options\OptionsPage.cs" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user