mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-16 06:08:16 +08:00
Fix generic arguments for parameterless struct ctors
This commit is contained in:
parent
3b71b40843
commit
f1ca484712
@ -30,9 +30,11 @@ namespace UnityExplorer.CacheObject
|
|||||||
|
|
||||||
public override void SetInspectorOwner(ReflectionInspector inspector, MemberInfo member)
|
public override void SetInspectorOwner(ReflectionInspector inspector, MemberInfo member)
|
||||||
{
|
{
|
||||||
|
Type ctorReturnType;
|
||||||
// if is parameterless struct ctor
|
// if is parameterless struct ctor
|
||||||
if (typeForStructConstructor != null)
|
if (typeForStructConstructor != null)
|
||||||
{
|
{
|
||||||
|
ctorReturnType = typeForStructConstructor;
|
||||||
this.Owner = inspector;
|
this.Owner = inspector;
|
||||||
|
|
||||||
// eg. Vector3.Vector3()
|
// eg. Vector3.Vector3()
|
||||||
@ -43,12 +45,16 @@ namespace UnityExplorer.CacheObject
|
|||||||
this.NameLabelTextRaw = NameForFiltering;
|
this.NameLabelTextRaw = NameForFiltering;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
base.SetInspectorOwner(inspector, member);
|
||||||
|
|
||||||
base.SetInspectorOwner(inspector, member);
|
Arguments = CtorInfo.GetParameters();
|
||||||
|
ctorReturnType = CtorInfo.DeclaringType;
|
||||||
Arguments = CtorInfo.GetParameters();
|
}
|
||||||
if (CtorInfo.DeclaringType.IsGenericTypeDefinition)
|
|
||||||
GenericArguments = CtorInfo.DeclaringType.GetGenericArguments();
|
if (ctorReturnType.IsGenericTypeDefinition)
|
||||||
|
GenericArguments = ctorReturnType.GetGenericArguments();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override object TryEvaluate()
|
protected override object TryEvaluate()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user