구글 스프레드 Sprite 로직 변경, Enum 클래스 생성 방식 변경
This commit is contained in:
parent
8b2db5f5d4
commit
299173df4e
@ -390,20 +390,24 @@ private void GenerateClassFilesPerSheet(string jsonInput)
|
|||||||
StringBuilder enumCode = new();
|
StringBuilder enumCode = new();
|
||||||
enumCode.AppendLine("// <auto-generated>");
|
enumCode.AppendLine("// <auto-generated>");
|
||||||
enumCode.AppendLine("using System;\n");
|
enumCode.AppendLine("using System;\n");
|
||||||
|
enumCode.AppendLine();
|
||||||
|
enumCode.AppendLine($"namespace {_namespace}");
|
||||||
|
enumCode.AppendLine("{");
|
||||||
|
|
||||||
foreach (var kvp in enumCandidates)
|
foreach (var kvp in enumCandidates)
|
||||||
{
|
{
|
||||||
enumCode.AppendLine($"public enum {kvp.Key} \n{{");
|
enumCode.AppendLine($" public enum {kvp.Key} \n{{");
|
||||||
enumCode.AppendLine(" None = 0,");
|
enumCode.AppendLine(" None = 0,");
|
||||||
int index = 1;
|
int index = 1;
|
||||||
foreach (string value in kvp.Value)
|
foreach (string value in kvp.Value)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrWhiteSpace(value) && value != "None")
|
if (!string.IsNullOrWhiteSpace(value) && value != "None")
|
||||||
enumCode.AppendLine($" {value} = {index++},");
|
enumCode.AppendLine($" {value} = {index++},");
|
||||||
}
|
}
|
||||||
|
|
||||||
enumCode.AppendLine("}\n");
|
enumCode.AppendLine(" }\n");
|
||||||
}
|
}
|
||||||
|
enumCode.AppendLine("}");
|
||||||
|
|
||||||
File.WriteAllText($"{BaseAssetPath}/EnumTypes.cs", enumCode.ToString());
|
File.WriteAllText($"{BaseAssetPath}/EnumTypes.cs", enumCode.ToString());
|
||||||
AssetDatabase.ImportAsset($"{BaseAssetPath}/EnumTypes.cs");
|
AssetDatabase.ImportAsset($"{BaseAssetPath}/EnumTypes.cs");
|
||||||
@ -459,6 +463,7 @@ private string GenerateDataClassCode(string className, JArray items)
|
|||||||
sb.AppendLine("// <auto-generated>");
|
sb.AppendLine("// <auto-generated>");
|
||||||
sb.AppendLine("using System;");
|
sb.AppendLine("using System;");
|
||||||
sb.AppendLine("using UnityEngine;");
|
sb.AppendLine("using UnityEngine;");
|
||||||
|
sb.AppendLine();
|
||||||
sb.AppendLine($"namespace {_namespace}");
|
sb.AppendLine($"namespace {_namespace}");
|
||||||
sb.AppendLine("{");
|
sb.AppendLine("{");
|
||||||
sb.AppendLine(" [Serializable]");
|
sb.AppendLine(" [Serializable]");
|
||||||
@ -672,7 +677,7 @@ private async Task<bool> InternalCreateGoogleSheetSoAsync()
|
|||||||
if (string.IsNullOrEmpty(spriteKey))
|
if (string.IsNullOrEmpty(spriteKey))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!AddressableManager.HasLabel(spriteKey, "GoogleSheetSprite"))
|
if (!AddressableManager.HasLabel(spriteKey, "Sprite"))
|
||||||
{
|
{
|
||||||
Debug.LogWarning($"[GoogleSheetManager] Sprite 라벨 없음: {spriteKey}");
|
Debug.LogWarning($"[GoogleSheetManager] Sprite 라벨 없음: {spriteKey}");
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user