2020-10-28 07:14:00 +11:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
2020-11-03 20:59:13 +11:00
|
|
|
|
using UnityExplorer.Helpers;
|
|
|
|
|
using UnityEngine;
|
2020-11-09 21:38:25 +11:00
|
|
|
|
using UnityExplorer.Inspectors.Reflection;
|
|
|
|
|
using UnityExplorer.UI.Shared;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using UnityExplorer.UI;
|
|
|
|
|
using UnityEngine.UI;
|
2020-11-11 20:16:43 +11:00
|
|
|
|
using UnityExplorer.Config;
|
2020-10-28 07:14:00 +11:00
|
|
|
|
|
2020-11-05 17:33:04 +11:00
|
|
|
|
namespace UnityExplorer.Inspectors
|
2020-10-28 07:14:00 +11:00
|
|
|
|
{
|
2020-11-11 20:16:43 +11:00
|
|
|
|
// TODO:
|
|
|
|
|
// - Filters
|
|
|
|
|
// - Helper tools for Target object (for UnityEngine.Objects, Components, Textures, and maybe a general ToString helper)
|
|
|
|
|
|
2020-10-28 07:14:00 +11:00
|
|
|
|
public class ReflectionInspector : InspectorBase
|
|
|
|
|
{
|
2020-11-12 16:15:41 +11:00
|
|
|
|
#region STATIC
|
|
|
|
|
|
|
|
|
|
public static ReflectionInspector ActiveInstance { get; private set; }
|
|
|
|
|
|
|
|
|
|
static ReflectionInspector()
|
|
|
|
|
{
|
|
|
|
|
PanelDragger.OnFinishResize += OnContainerResized;
|
|
|
|
|
SceneExplorer.OnToggleShow += OnContainerResized;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void OnContainerResized()
|
|
|
|
|
{
|
|
|
|
|
if (ActiveInstance == null)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
ActiveInstance.m_widthUpdateWanted = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Blacklists
|
|
|
|
|
private static readonly HashSet<string> s_typeAndMemberBlacklist = new HashSet<string>
|
|
|
|
|
{
|
2020-11-13 18:46:36 +11:00
|
|
|
|
#if CPP
|
|
|
|
|
// these cause a crash in IL2CPP
|
2020-11-12 16:15:41 +11:00
|
|
|
|
"Type.DeclaringMethod",
|
|
|
|
|
"Rigidbody2D.Cast",
|
|
|
|
|
"Collider2D.Cast",
|
|
|
|
|
"Collider2D.Raycast",
|
2020-11-13 18:46:36 +11:00
|
|
|
|
"Texture2D.SetPixelDataImpl",
|
|
|
|
|
#endif
|
2020-11-12 16:15:41 +11:00
|
|
|
|
};
|
|
|
|
|
private static readonly HashSet<string> s_methodStartsWithBlacklist = new HashSet<string>
|
|
|
|
|
{
|
|
|
|
|
// these are redundant
|
|
|
|
|
"get_",
|
|
|
|
|
"set_",
|
|
|
|
|
};
|
|
|
|
|
|
2020-11-13 18:46:36 +11:00
|
|
|
|
#endregion
|
2020-11-12 16:15:41 +11:00
|
|
|
|
|
2020-11-13 18:46:36 +11:00
|
|
|
|
#region INSTANCE
|
2020-11-12 16:15:41 +11:00
|
|
|
|
|
2020-10-28 07:14:00 +11:00
|
|
|
|
public override string TabLabel => m_targetTypeShortName;
|
|
|
|
|
|
2020-11-12 16:15:41 +11:00
|
|
|
|
public bool AutoUpdate { get; set; }
|
|
|
|
|
|
2020-11-09 21:38:25 +11:00
|
|
|
|
internal readonly Type m_targetType;
|
|
|
|
|
internal readonly string m_targetTypeShortName;
|
|
|
|
|
|
|
|
|
|
// all cached members of the target
|
|
|
|
|
internal CacheMember[] m_allMembers;
|
|
|
|
|
// filtered members based on current filters
|
2020-11-11 20:16:43 +11:00
|
|
|
|
internal CacheMember[] m_membersFiltered;
|
2020-11-09 21:38:25 +11:00
|
|
|
|
// actual shortlist of displayed members
|
2020-11-11 20:16:43 +11:00
|
|
|
|
internal readonly CacheMember[] m_displayedMembers = new CacheMember[ModConfig.Instance.Default_Page_Limit];
|
2020-11-09 21:38:25 +11:00
|
|
|
|
|
|
|
|
|
// UI members
|
|
|
|
|
|
2020-11-03 20:59:13 +11:00
|
|
|
|
private GameObject m_content;
|
|
|
|
|
public override GameObject Content
|
|
|
|
|
{
|
|
|
|
|
get => m_content;
|
|
|
|
|
set => m_content = value;
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-11 20:16:43 +11:00
|
|
|
|
internal PageHandler m_pageHandler;
|
|
|
|
|
internal SliderScrollbar m_sliderScroller;
|
|
|
|
|
internal GameObject m_scrollContent;
|
2020-11-12 16:15:41 +11:00
|
|
|
|
internal RectTransform m_scrollContentRect;
|
|
|
|
|
|
|
|
|
|
internal bool m_widthUpdateWanted;
|
|
|
|
|
internal bool m_widthUpdateWaiting;
|
2020-11-09 21:38:25 +11:00
|
|
|
|
|
|
|
|
|
// Ctor
|
2020-10-28 07:14:00 +11:00
|
|
|
|
|
|
|
|
|
public ReflectionInspector(object target) : base(target)
|
|
|
|
|
{
|
2020-11-09 21:38:25 +11:00
|
|
|
|
if (this is StaticInspector)
|
|
|
|
|
m_targetType = target as Type;
|
|
|
|
|
else
|
|
|
|
|
m_targetType = ReflectionHelpers.GetActualType(target);
|
|
|
|
|
|
|
|
|
|
m_targetTypeShortName = m_targetType.Name;
|
|
|
|
|
|
2020-11-11 20:16:43 +11:00
|
|
|
|
ConstructUI();
|
|
|
|
|
|
2020-11-09 21:38:25 +11:00
|
|
|
|
CacheMembers(m_targetType);
|
|
|
|
|
|
2020-11-11 20:16:43 +11:00
|
|
|
|
RefreshDisplay();
|
2020-11-09 21:38:25 +11:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Methods
|
|
|
|
|
|
2020-11-12 16:15:41 +11:00
|
|
|
|
public override void SetActive()
|
|
|
|
|
{
|
|
|
|
|
base.SetActive();
|
|
|
|
|
ActiveInstance = this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void SetInactive()
|
|
|
|
|
{
|
|
|
|
|
base.SetInactive();
|
|
|
|
|
ActiveInstance = null;
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-09 21:38:25 +11:00
|
|
|
|
public override void Update()
|
|
|
|
|
{
|
|
|
|
|
base.Update();
|
|
|
|
|
|
2020-11-12 16:15:41 +11:00
|
|
|
|
if (AutoUpdate)
|
|
|
|
|
{
|
|
|
|
|
foreach (var member in m_displayedMembers)
|
|
|
|
|
{
|
|
|
|
|
member.UpdateValue();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_widthUpdateWanted)
|
|
|
|
|
{
|
|
|
|
|
if (!m_widthUpdateWaiting)
|
|
|
|
|
m_widthUpdateWaiting = true;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
UpdateWidths();
|
|
|
|
|
m_widthUpdateWaiting = false;
|
|
|
|
|
m_widthUpdateWanted = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-11-09 21:38:25 +11:00
|
|
|
|
}
|
2020-10-28 07:14:00 +11:00
|
|
|
|
|
2020-11-09 21:38:25 +11:00
|
|
|
|
public override void Destroy()
|
|
|
|
|
{
|
|
|
|
|
base.Destroy();
|
|
|
|
|
|
|
|
|
|
if (this.Content)
|
|
|
|
|
GameObject.Destroy(this.Content);
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-11 20:16:43 +11:00
|
|
|
|
private void OnPageTurned()
|
|
|
|
|
{
|
|
|
|
|
RefreshDisplay();
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-12 20:31:08 +11:00
|
|
|
|
public void RefreshDisplay()
|
2020-11-11 20:16:43 +11:00
|
|
|
|
{
|
2020-11-12 16:15:41 +11:00
|
|
|
|
// temp because not doing filtering yet
|
2020-11-11 20:16:43 +11:00
|
|
|
|
m_membersFiltered = m_allMembers;
|
|
|
|
|
|
|
|
|
|
var members = m_membersFiltered;
|
|
|
|
|
m_pageHandler.ListCount = members.Length;
|
|
|
|
|
|
2020-11-12 20:31:08 +11:00
|
|
|
|
// disable current members
|
|
|
|
|
for (int i = 0; i < m_displayedMembers.Length; i++)
|
2020-11-11 20:16:43 +11:00
|
|
|
|
{
|
2020-11-12 20:31:08 +11:00
|
|
|
|
var mem = m_displayedMembers[i];
|
|
|
|
|
if (mem != null)
|
|
|
|
|
mem.Disable();
|
|
|
|
|
else
|
|
|
|
|
break;
|
2020-11-11 20:16:43 +11:00
|
|
|
|
}
|
|
|
|
|
|
2020-11-12 16:15:41 +11:00
|
|
|
|
if (members.Length < 1)
|
|
|
|
|
return;
|
|
|
|
|
|
2020-11-11 20:16:43 +11:00
|
|
|
|
foreach (var itemIndex in m_pageHandler)
|
|
|
|
|
{
|
|
|
|
|
if (itemIndex >= members.Length)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
CacheMember member = members[itemIndex];
|
2020-11-12 16:15:41 +11:00
|
|
|
|
m_displayedMembers[itemIndex - m_pageHandler.StartIndex] = member;
|
2020-11-11 20:16:43 +11:00
|
|
|
|
member.Enable();
|
2020-11-12 16:15:41 +11:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_widthUpdateWanted = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal void UpdateWidths()
|
|
|
|
|
{
|
|
|
|
|
float labelWidth = 125;
|
|
|
|
|
|
|
|
|
|
foreach (var cache in m_displayedMembers)
|
|
|
|
|
{
|
|
|
|
|
if (cache == null)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
var width = cache.GetMemberLabelWidth(m_scrollContentRect);
|
|
|
|
|
|
|
|
|
|
if (width > labelWidth)
|
|
|
|
|
labelWidth = width;
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-12 20:31:08 +11:00
|
|
|
|
float valueWidth = m_scrollContentRect.rect.width - labelWidth - 20;
|
2020-11-11 20:16:43 +11:00
|
|
|
|
|
2020-11-12 16:15:41 +11:00
|
|
|
|
foreach (var cache in m_displayedMembers)
|
|
|
|
|
{
|
|
|
|
|
if (cache == null)
|
|
|
|
|
break;
|
|
|
|
|
cache.SetWidths(labelWidth, valueWidth);
|
2020-11-11 20:16:43 +11:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-09 21:38:25 +11:00
|
|
|
|
public void CacheMembers(Type type)
|
|
|
|
|
{
|
|
|
|
|
var list = new List<CacheMember>();
|
|
|
|
|
var cachedSigs = new HashSet<string>();
|
|
|
|
|
|
|
|
|
|
var types = ReflectionHelpers.GetAllBaseTypes(type);
|
|
|
|
|
|
|
|
|
|
foreach (var declaringType in types)
|
2020-10-28 07:14:00 +11:00
|
|
|
|
{
|
2020-11-09 21:38:25 +11:00
|
|
|
|
MemberInfo[] infos;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
infos = declaringType.GetMembers(ReflectionHelpers.CommonFlags);
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
ExplorerCore.Log($"Exception getting members for type: {declaringType.FullName}");
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var target = Target;
|
|
|
|
|
#if CPP
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
target = target.Il2CppCast(declaringType);
|
|
|
|
|
}
|
|
|
|
|
catch //(Exception e)
|
|
|
|
|
{
|
|
|
|
|
//ExplorerCore.LogWarning("Excepting casting " + target.GetType().FullName + " to " + declaringType.FullName);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
foreach (var member in infos)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
2020-11-13 18:46:36 +11:00
|
|
|
|
//ExplorerCore.Log($"Trying to cache member {sig}...");
|
|
|
|
|
//ExplorerCore.Log(member.DeclaringType.FullName + "." + member.Name);
|
|
|
|
|
|
2020-11-09 21:38:25 +11:00
|
|
|
|
// make sure member type is Field, Method or Property (4 / 8 / 16)
|
|
|
|
|
int m = (int)member.MemberType;
|
|
|
|
|
if (m < 4 || m > 16)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
var pi = member as PropertyInfo;
|
|
|
|
|
var mi = member as MethodInfo;
|
|
|
|
|
|
|
|
|
|
if (this is StaticInspector)
|
|
|
|
|
{
|
|
|
|
|
if (member is FieldInfo fi && !fi.IsStatic) continue;
|
|
|
|
|
else if (pi != null && !pi.GetAccessors(true)[0].IsStatic) continue;
|
|
|
|
|
else if (mi != null && !mi.IsStatic) continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// check blacklisted members
|
|
|
|
|
var sig = $"{member.DeclaringType.Name}.{member.Name}";
|
2020-11-10 20:18:14 +11:00
|
|
|
|
|
|
|
|
|
if (s_typeAndMemberBlacklist.Any(it => sig.Contains(it)))
|
2020-11-09 21:38:25 +11:00
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if (s_methodStartsWithBlacklist.Any(it => member.Name.StartsWith(it)))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if (mi != null)
|
|
|
|
|
{
|
2020-11-10 20:31:48 +11:00
|
|
|
|
AppendParams(mi.GetParameters());
|
2020-11-09 21:38:25 +11:00
|
|
|
|
}
|
|
|
|
|
else if (pi != null)
|
|
|
|
|
{
|
|
|
|
|
AppendParams(pi.GetIndexParameters());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AppendParams(ParameterInfo[] _args)
|
|
|
|
|
{
|
|
|
|
|
sig += " (";
|
|
|
|
|
foreach (var param in _args)
|
|
|
|
|
{
|
|
|
|
|
sig += $"{param.ParameterType.Name} {param.Name}, ";
|
|
|
|
|
}
|
|
|
|
|
sig += ")";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (cachedSigs.Contains(sig))
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
2020-11-11 20:16:43 +11:00
|
|
|
|
var cached = CacheFactory.GetCacheObject(member, target, m_scrollContent);
|
2020-11-09 21:38:25 +11:00
|
|
|
|
|
|
|
|
|
if (cached != null)
|
|
|
|
|
{
|
|
|
|
|
cachedSigs.Add(sig);
|
|
|
|
|
list.Add(cached);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
ExplorerCore.LogWarning($"Exception caching member {sig}!");
|
|
|
|
|
ExplorerCore.Log(e.ToString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
ExplorerCore.LogWarning($"Exception caching member {member.DeclaringType.FullName}.{member.Name}!");
|
|
|
|
|
ExplorerCore.Log(e.ToString());
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-10-28 07:14:00 +11:00
|
|
|
|
}
|
|
|
|
|
|
2020-11-12 16:15:41 +11:00
|
|
|
|
var sorted = new List<CacheMember>();
|
|
|
|
|
sorted.AddRange(list.Where(x => x is CacheMethod));
|
|
|
|
|
sorted.AddRange(list.Where(x => x is CacheProperty));
|
|
|
|
|
sorted.AddRange(list.Where(x => x is CacheField));
|
|
|
|
|
|
|
|
|
|
m_allMembers = sorted.ToArray();
|
2020-11-09 21:38:25 +11:00
|
|
|
|
|
2020-11-10 20:18:14 +11:00
|
|
|
|
// ExplorerCore.Log("Cached " + m_allMembers.Length + " members");
|
2020-11-09 21:38:25 +11:00
|
|
|
|
}
|
|
|
|
|
|
2020-11-13 18:46:36 +11:00
|
|
|
|
#region UI CONSTRUCTION
|
2020-11-09 21:38:25 +11:00
|
|
|
|
|
|
|
|
|
internal void ConstructUI()
|
|
|
|
|
{
|
|
|
|
|
var parent = InspectorManager.Instance.m_inspectorContent;
|
|
|
|
|
this.Content = UIFactory.CreateVerticalGroup(parent, new Color(0.15f, 0.15f, 0.15f));
|
|
|
|
|
var mainGroup = Content.GetComponent<VerticalLayoutGroup>();
|
|
|
|
|
mainGroup.childForceExpandHeight = false;
|
|
|
|
|
mainGroup.childForceExpandWidth = true;
|
|
|
|
|
mainGroup.childControlHeight = true;
|
|
|
|
|
mainGroup.childControlWidth = true;
|
|
|
|
|
mainGroup.spacing = 5;
|
|
|
|
|
mainGroup.padding.top = 4;
|
|
|
|
|
mainGroup.padding.left = 4;
|
|
|
|
|
mainGroup.padding.right = 4;
|
|
|
|
|
mainGroup.padding.bottom = 4;
|
|
|
|
|
|
|
|
|
|
ConstructTopArea();
|
|
|
|
|
|
|
|
|
|
ConstructFilterArea();
|
|
|
|
|
|
|
|
|
|
ConstructMemberList();
|
2020-10-28 07:14:00 +11:00
|
|
|
|
}
|
|
|
|
|
|
2020-11-09 21:38:25 +11:00
|
|
|
|
internal void ConstructTopArea()
|
|
|
|
|
{
|
|
|
|
|
var typeRowObj = UIFactory.CreateHorizontalGroup(Content, new Color(1, 1, 1, 0));
|
|
|
|
|
var typeRowGroup = typeRowObj.GetComponent<HorizontalLayoutGroup>();
|
|
|
|
|
typeRowGroup.childForceExpandWidth = true;
|
|
|
|
|
typeRowGroup.childForceExpandHeight = true;
|
|
|
|
|
typeRowGroup.childControlHeight = true;
|
|
|
|
|
typeRowGroup.childControlWidth = true;
|
|
|
|
|
var typeRowLayout = typeRowObj.AddComponent<LayoutElement>();
|
|
|
|
|
typeRowLayout.minHeight = 25;
|
|
|
|
|
typeRowLayout.flexibleHeight = 0;
|
|
|
|
|
typeRowLayout.minWidth = 200;
|
|
|
|
|
typeRowLayout.flexibleWidth = 5000;
|
|
|
|
|
|
|
|
|
|
var typeLabel = UIFactory.CreateLabel(typeRowObj, TextAnchor.MiddleLeft);
|
|
|
|
|
var typeLabelText = typeLabel.GetComponent<Text>();
|
|
|
|
|
typeLabelText.text = "Type:";
|
2020-11-12 20:31:08 +11:00
|
|
|
|
typeLabelText.horizontalOverflow = HorizontalWrapMode.Overflow;
|
2020-11-09 21:38:25 +11:00
|
|
|
|
var typeLabelTextLayout = typeLabel.AddComponent<LayoutElement>();
|
|
|
|
|
typeLabelTextLayout.minWidth = 60;
|
|
|
|
|
typeLabelTextLayout.flexibleWidth = 0;
|
|
|
|
|
typeLabelTextLayout.minHeight = 25;
|
|
|
|
|
|
2020-11-10 20:18:14 +11:00
|
|
|
|
var typeLabelInputObj = UIFactory.CreateInputField(typeRowObj);
|
|
|
|
|
var typeLabelInput = typeLabelInputObj.GetComponent<InputField>();
|
2020-11-09 21:38:25 +11:00
|
|
|
|
typeLabelInput.readOnly = true;
|
|
|
|
|
var typeLabelLayout = typeLabelInputObj.AddComponent<LayoutElement>();
|
|
|
|
|
typeLabelLayout.minWidth = 150;
|
|
|
|
|
typeLabelLayout.flexibleWidth = 5000;
|
|
|
|
|
|
2020-11-13 18:46:36 +11:00
|
|
|
|
typeLabelInput.text = UISyntaxHighlight.ParseFullSyntax(m_targetType, true);
|
2020-11-12 20:31:08 +11:00
|
|
|
|
|
|
|
|
|
// Helper tools
|
|
|
|
|
|
2020-11-13 18:46:36 +11:00
|
|
|
|
if (this is InstanceInspector instanceInspector)
|
2020-11-12 20:31:08 +11:00
|
|
|
|
{
|
2020-11-13 18:46:36 +11:00
|
|
|
|
instanceInspector.ConstructInstanceHelpers(Content);
|
2020-11-12 20:31:08 +11:00
|
|
|
|
}
|
2020-11-09 21:38:25 +11:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal void ConstructFilterArea()
|
|
|
|
|
{
|
2020-11-12 20:31:08 +11:00
|
|
|
|
var filterAreaObj = UIFactory.CreateVerticalGroup(Content, new Color(0.1f, 0.1f, 0.1f));
|
|
|
|
|
var filterLayout = filterAreaObj.AddComponent<LayoutElement>();
|
|
|
|
|
filterLayout.minHeight = 25;
|
|
|
|
|
var filterGroup = filterAreaObj.GetComponent<VerticalLayoutGroup>();
|
|
|
|
|
filterGroup.childForceExpandWidth = true;
|
|
|
|
|
filterGroup.childForceExpandHeight = false;
|
|
|
|
|
filterGroup.childControlWidth = true;
|
|
|
|
|
filterGroup.childControlHeight = true;
|
|
|
|
|
|
|
|
|
|
// name filter
|
|
|
|
|
|
|
|
|
|
|
2020-11-09 21:38:25 +11:00
|
|
|
|
|
2020-11-12 20:31:08 +11:00
|
|
|
|
// membertype filter
|
2020-11-12 16:15:41 +11:00
|
|
|
|
|
|
|
|
|
|
2020-11-12 20:31:08 +11:00
|
|
|
|
|
|
|
|
|
// Instance filters
|
|
|
|
|
|
2020-11-13 18:46:36 +11:00
|
|
|
|
if (this is InstanceInspector instanceInspector)
|
2020-11-12 20:31:08 +11:00
|
|
|
|
{
|
2020-11-13 18:46:36 +11:00
|
|
|
|
instanceInspector.ConstructInstanceFilters(filterAreaObj);
|
2020-11-12 20:31:08 +11:00
|
|
|
|
}
|
2020-11-09 21:38:25 +11:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal void ConstructMemberList()
|
|
|
|
|
{
|
2020-11-11 20:16:43 +11:00
|
|
|
|
var scrollobj = UIFactory.CreateScrollView(Content, out m_scrollContent, out m_sliderScroller, new Color(0.12f, 0.12f, 0.12f));
|
2020-11-09 21:38:25 +11:00
|
|
|
|
|
2020-11-12 16:15:41 +11:00
|
|
|
|
m_scrollContentRect = m_scrollContent.GetComponent<RectTransform>();
|
|
|
|
|
|
2020-11-11 20:16:43 +11:00
|
|
|
|
var scrollGroup = m_scrollContent.GetComponent<VerticalLayoutGroup>();
|
|
|
|
|
scrollGroup.spacing = 3;
|
2020-11-13 18:46:36 +11:00
|
|
|
|
scrollGroup.padding.left = 0;
|
|
|
|
|
scrollGroup.padding.right = 0;
|
2020-11-09 21:38:25 +11:00
|
|
|
|
|
2020-11-11 20:16:43 +11:00
|
|
|
|
m_pageHandler = new PageHandler(m_sliderScroller);
|
|
|
|
|
m_pageHandler.ConstructUI(Content);
|
|
|
|
|
m_pageHandler.OnPageChanged += OnPageTurned;
|
2020-11-09 21:38:25 +11:00
|
|
|
|
}
|
2020-10-28 07:14:00 +11:00
|
|
|
|
|
2020-11-13 18:46:36 +11:00
|
|
|
|
#endregion
|
2020-11-12 16:15:41 +11:00
|
|
|
|
|
2020-11-13 18:46:36 +11:00
|
|
|
|
#endregion
|
2020-10-28 07:14:00 +11:00
|
|
|
|
}
|
|
|
|
|
}
|