public static void AddTypeInterfaces(this Type type, HashSet <string> interfaces, TypeResolverGroup typeResolverGroup) { if (type == null) { return; } foreach (var Interface in type.GetInterfaces()) { if (typeResolverGroup.GetTypeFromTypeString(UdonTypeExporter.GenerateUdonName(Interface)) != null) { interfaces.Add(UdonTypeExporter.GetTypeFullName(Interface)); Interface.AddTypeInterfaces(interfaces, typeResolverGroup); } } }
private static string RecurseInheritedType(Type originalType, Type type, TypeResolverGroup typeResolverGroup) { if (type == null || type == typeof(object)) { return(""); } if (originalType == type) { return(RecurseInheritedType(originalType, type.BaseType, typeResolverGroup)); } if (typeResolverGroup.GetTypeFromTypeString(UdonTypeExporter.GenerateUdonName(type)) != null) { return(UdonTypeExporter.GetTypeFullName(type)); } if (type.BaseType != null) { return(RecurseInheritedType(originalType, type.BaseType, typeResolverGroup)); } return(""); }