Files
CinematicUnityExplorer/src/CachedObjects/CacheIl2CppObject.cs
T
sinaioutlander b264151c46 1.4.0
- Wrote the CacheObject class to replace MemberInfoHolder, resulting code is better perfomance and much easier to read.
- Added pages to Object Reflection window, now limited to 20 members per page to improve performance further.
2020-08-22 00:16:05 +10:00

38 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace Explorer
{
public class CacheIl2CppObject : CacheObject
{
public override void DrawValue(Rect window, float width)
{
var label = ValueType ?? Value.ToString();
if (!label.Contains(ValueType))
{
label += $" ({ValueType})";
}
if (Value is UnityEngine.Object unityObj)
{
label = unityObj.name + " | " + label;
}
GUI.skin.button.alignment = TextAnchor.MiddleLeft;
if (GUILayout.Button("<color=yellow>" + label + "</color>", new GUILayoutOption[] { GUILayout.MaxWidth(width) }))
{
WindowManager.InspectObject(Value, out bool _);
}
GUI.skin.button.alignment = TextAnchor.MiddleCenter;
}
public override void SetValue()
{
throw new NotImplementedException("TODO");
}
}
}