public static void GenerateConstStaticClasses(string outputPath, string namespaceName) { CodeSerializer.ResetDirectory(outputPath); GenerateConstStaticClass(outputPath, namespaceName, "TagName", NameGetter.GetTags()); GenerateConstStaticClass(outputPath, namespaceName, "LayerName", NameGetter.GetLayers().Select(l => l.Name).ToArray()); GenerateConstStaticClass(outputPath, namespaceName, "SceneName", NameGetter.GetScenes().Select(s => s.Name).ToArray()); GenerateConstStaticClass(outputPath, namespaceName, "SortingLayerName", NameGetter.GetSortingLayers().Select(s => s.Name).ToArray()); AssetDatabase.Refresh(); }
public static void GenerateNamesCodes(string outputPath, string namespaceName, bool isGenerateExtensions) { CodeSerializer.ResetDirectory(outputPath); GenerateStructAndParent(outputPath, namespaceName, "Tags", "TagName", NameGetter.GetTags()); GenerateStructAndParent(outputPath, namespaceName, "Layers", "LayerName", new[] { Member.StringName, Member.IntIndex }, NameGetter.GetLayers()); GenerateStructAndParent(outputPath, namespaceName, "Scenes", "SceneName", new[] { Member.StringName, Member.IntIndex }, NameGetter.GetScenes()); GenerateStructAndParent(outputPath, namespaceName, "SortingLayers", "SortingLayerName", new[] { Member.StringName, Member.IntId }, NameGetter.GetSortingLayers()); if (isGenerateExtensions) { ExtensionCodeGenerator.GenerateExtensionCodes(outputPath, namespaceName); } AssetDatabase.Refresh(); }