mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-15 22:07:48 +08:00
Recache types when borrowing
This commit is contained in:
parent
abf5267364
commit
7e5246cead
@ -7,20 +7,21 @@ namespace UnityExplorer.UI.Widgets
|
|||||||
{
|
{
|
||||||
public class GenericArgumentHandler : BaseArgumentHandler
|
public class GenericArgumentHandler : BaseArgumentHandler
|
||||||
{
|
{
|
||||||
private Type genericType;
|
private Type genericArgument;
|
||||||
|
|
||||||
public void OnBorrowed(Type genericConstraint)
|
public void OnBorrowed(Type genericArgument)
|
||||||
{
|
{
|
||||||
this.genericType = genericConstraint;
|
this.genericArgument = genericArgument;
|
||||||
|
|
||||||
typeCompleter.Enabled = true;
|
typeCompleter.Enabled = true;
|
||||||
typeCompleter.BaseType = genericType;
|
typeCompleter.BaseType = this.genericArgument;
|
||||||
typeCompleter.CacheTypes();
|
|
||||||
|
|
||||||
Type[] constraints = genericType.GetGenericParameterConstraints();
|
Type[] constraints = this.genericArgument.GetGenericParameterConstraints();
|
||||||
typeCompleter.GenericConstraints = constraints;
|
typeCompleter.GenericConstraints = constraints;
|
||||||
|
|
||||||
StringBuilder sb = new($"<color={SignatureHighlighter.CONST}>{genericType.Name}</color>");
|
typeCompleter.CacheTypes();
|
||||||
|
|
||||||
|
StringBuilder sb = new($"<color={SignatureHighlighter.CONST}>{this.genericArgument.Name}</color>");
|
||||||
|
|
||||||
for (int j = 0; j < constraints.Length; j++)
|
for (int j = 0; j < constraints.Length; j++)
|
||||||
{
|
{
|
||||||
@ -38,7 +39,7 @@ namespace UnityExplorer.UI.Widgets
|
|||||||
|
|
||||||
public void OnReturned()
|
public void OnReturned()
|
||||||
{
|
{
|
||||||
this.genericType = null;
|
this.genericArgument = null;
|
||||||
|
|
||||||
this.typeCompleter.Enabled = false;
|
this.typeCompleter.Enabled = false;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user