internal UnityTypeReference(string builtInType, EnumDefinitionRaw enumDefinition, UnityTypeDefinition typeDefinition) { this.builtInType = builtInType; this.enumDefinition = enumDefinition; this.typeDefinition = typeDefinition; }
public string Generate(UnityTypeDefinition typeDefinition, string package, HashSet <string> enumSet) { qualifiedNamespace = UnityTypeMappings.PackagePrefix + package; this.typeDefinition = typeDefinition; this.enumSet = enumSet; return(TransformText()); }
public string Generate(UnityTypeDefinition typeDefinition, HashSet <string> enumSet) { this.typeDefinition = typeDefinition; this.enumSet = enumSet; this.nestedTypes = typeDefinition.TypeDefinitions; this.nestedEnums = typeDefinition.EnumDefinitions.ToList(); return(TransformText()); }
public UnityTypeDetails(UnityTypeDefinition typeDefinition) { CapitalisedName = Formatting.SnakeCaseToCapitalisedCamelCase(typeDefinition.Name); CamelCaseName = Formatting.SnakeCaseToCamelCase(typeDefinition.Name); FullyQualifiedSpatialTypeName = "global::" + Formatting.CapitaliseQualifiedNameParts(typeDefinition.QualifiedName); FullyQualifiedTypeName = "global::" + Formatting.CapitaliseQualifiedNameParts(typeDefinition.QualifiedName); }
private void ExtractEnums(UnityTypeDefinition typeDefinition, HashSet <string> enumSet) { foreach (var enumDefinition in typeDefinition.EnumDefinitions) { enumSet.Add(enumDefinition.qualifiedName); } foreach (var nestedTypeDefinition in typeDefinition.TypeDefinitions) { ExtractEnums(nestedTypeDefinition, enumSet); } }
private static bool ApplyBlittableMarkerToTypeRecursively(UnityTypeDefinition typeDefinition, Dictionary <string, bool> blittableTypeMap, Dictionary <string, UnityTypeDefinition> unvisited) { var isBlittable = typeDefinition.FieldDefinitions.All(fieldDefinition => CanBlitFieldOfTypeRecursively(fieldDefinition, blittableTypeMap, unvisited)); typeDefinition.IsBlittable = isBlittable; blittableTypeMap[typeDefinition.QualifiedName] = isBlittable; unvisited.Remove(typeDefinition.QualifiedName); return(isBlittable); }
private static void PopulateTypeDefinitionsRecursively(Dictionary <string, UnityTypeDefinition> typeMap, HashSet <string> enumSet, UnityTypeDefinition typeDefinition) { foreach (var nestedTypeDefinition in typeDefinition.TypeDefinitions) { typeMap.Add(nestedTypeDefinition.QualifiedName, nestedTypeDefinition); PopulateTypeDefinitionsRecursively(typeMap, enumSet, nestedTypeDefinition); } foreach (var nestedEnumDefinition in typeDefinition.EnumDefinitions) { enumSet.Add(nestedEnumDefinition.qualifiedName); } }