コード例 #1
0
        private static void GenerateStructAndParent(string outputPath, string className, string structName,
                                                    IEnumerable <NameWithNumber> nameWithNumbers)
        {
            var code = new StaticClassCodeBuilder()
                       .AddHeaderCommend(HeaderComment)
                       .AddNamespace(NamespaceName)
                       .AddClass(className)
                       .AddObjectParameters(structName, nameWithNumbers)
                       .Build();

            CodeSerializer.WriteCodeFile(outputPath, code, className);
        }
コード例 #2
0
        private static void Generate(GeneratorSetting setting)
        {
            CodeSerializer.ResetDirectory(setting.OutputDirectory);

            GenerateStructAndParent(setting.OutputDirectory, "Tags", "TagName", NameGetter.GetTags());
            GenerateStructAndParent(setting.OutputDirectory, "Layers", "LayerName", NameGetter.GetLayers());
            GenerateStructAndParent(setting.OutputDirectory, "Scenes", "SceneName", NameGetter.GetScenes());
            GenerateStructAndParent(setting.OutputDirectory, "SortingLayers", "SortingLayerName",
                                    NameGetter.GetSortingLayers());

            AssetDatabase.Refresh();
        }