Fix some issues in IL2CPP, improve type cache efficiency, reduce alloc

This commit is contained in:
Sinai
2021-05-06 04:02:42 +10:00
parent e4ff86259b
commit 22435176bf
21 changed files with 300 additions and 183 deletions

View File

@ -160,7 +160,7 @@ namespace UnityExplorer.UI.Inspectors
if (!compToStringCache.ContainsKey(type.AssemblyQualifiedName))
{
compToStringCache.Add(type.AssemblyQualifiedName, SignatureHighlighter.ParseType(type, true));
compToStringCache.Add(type.AssemblyQualifiedName, SignatureHighlighter.Parse(type, true));
}
cell.Button.ButtonText.text = compToStringCache[type.AssemblyQualifiedName];

View File

@ -128,8 +128,8 @@ namespace UnityExplorer.UI.Inspectors
}
// Setup main labels and tab text
Tab.TabText.text = $"{prefix} {SignatureHighlighter.ParseType(TargetType)}";
NameText.text = SignatureHighlighter.ParseFullSyntax(TargetType, true);
Tab.TabText.text = $"{prefix} {SignatureHighlighter.Parse(TargetType, false)}";
NameText.text = SignatureHighlighter.Parse(TargetType, true);
string asmText;
if (TargetType.Assembly != null && !string.IsNullOrEmpty(TargetType.Assembly.Location))
@ -230,6 +230,7 @@ namespace UnityExplorer.UI.Inspectors
private void UpdateDisplayedMembers()// bool onlyAutoUpdate)
{
ExplorerCore.Log("Updating values...");
bool shouldRefresh = false;
foreach (var cell in MemberScrollPool.CellPool)
{
@ -238,6 +239,7 @@ namespace UnityExplorer.UI.Inspectors
var member = cell.MemberOccupant;
if (member.ShouldAutoEvaluate) // && (!onlyAutoUpdate || member.AutoUpdateWanted))
{
ExplorerCore.Log("Evaluating cell " + cell.MemberOccupant.NameForFiltering);
shouldRefresh = true;
member.Evaluate();
member.SetDataToCell(member.CellView);