Skip to content

Commit

Permalink
Add handling for nested type naming
Browse files Browse the repository at this point in the history
- Fix issue with finding the correct names for nested types. This affected player tracking data and probably particle systems.
  • Loading branch information
MerlinVR committed Feb 12, 2020
1 parent a457359 commit 9036bd1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Assets/UdonSharp/Editor/UdonSharpResolverContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,20 @@ public string GetUdonTypeName(System.Type externType)
{
string externTypeName = externType.GetNameWithoutGenericArity();
string typeNamespace = externType.Namespace;
if (externType.DeclaringType != null)
{
string declaringTypeNamespace = "";

System.Type declaringType = externType.DeclaringType;

while (declaringType != null)
{
declaringTypeNamespace = $"{externType.DeclaringType.Name}.{declaringTypeNamespace}";
declaringType = declaringType.DeclaringType;
}

typeNamespace += $".{declaringTypeNamespace}";
}

if (externTypeName == "T" || externTypeName == "T[]")
typeNamespace = "";
Expand Down

0 comments on commit 9036bd1

Please sign in to comment.