mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-17 22:48:04 +08:00

* Added MethodInfo support for basic methods with no arguments. * Added support for missing primitive types (char, short, byte) * Added CacheDictionary class (currently unsupported) * Cleaned up some stuff, using System.Reflection.MemberType instead of a custom enum.
47 lines
1.2 KiB
C#
47 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using MelonLoader;
|
|
using UnityEngine;
|
|
|
|
namespace Explorer
|
|
{
|
|
public class CacheGameObject : CacheObjectBase
|
|
{
|
|
private GameObject GameObj
|
|
{
|
|
get
|
|
{
|
|
if (m_gameObject == null)
|
|
{
|
|
if (Value is Il2CppSystem.Object ilObj)
|
|
{
|
|
var ilType = ilObj.GetIl2CppType();
|
|
|
|
if (ilType == ReflectionHelpers.GameObjectType || ilType == ReflectionHelpers.TransformType)
|
|
{
|
|
m_gameObject = ilObj.TryCast<GameObject>() ?? ilObj.TryCast<Transform>()?.gameObject;
|
|
}
|
|
}
|
|
}
|
|
|
|
return m_gameObject;
|
|
}
|
|
}
|
|
|
|
private GameObject m_gameObject;
|
|
|
|
public override void DrawValue(Rect window, float width)
|
|
{
|
|
UIHelpers.GameobjButton(GameObj, null, false, width);
|
|
}
|
|
|
|
public override void UpdateValue()
|
|
{
|
|
base.UpdateValue();
|
|
}
|
|
}
|
|
}
|