54 lines
1.3 KiB
C#
54 lines
1.3 KiB
C#
using System;
|
|
using System.Linq;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.Serialization;
|
|
|
|
namespace AlicizaX.Localization
|
|
{
|
|
public class GameLocaizationTable : ScriptableObject
|
|
{
|
|
#if UNITY_EDITOR
|
|
[SerializeField] internal string GenerateScriptCodePath = string.Empty;
|
|
|
|
[Serializable]
|
|
public struct SheetItem
|
|
{
|
|
public int Id;
|
|
public string Key;
|
|
public bool IsGen;
|
|
|
|
public SheetItem(string key, int id, bool isGen)
|
|
{
|
|
Id = id;
|
|
Key = key;
|
|
IsGen = isGen;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public struct TableData
|
|
{
|
|
public int Id;
|
|
public string SectionName;
|
|
public List<SheetItem> SectionSheet;
|
|
|
|
public TableData(string section, int id)
|
|
{
|
|
Id = id;
|
|
SectionName = section;
|
|
SectionSheet = new List<SheetItem>();
|
|
}
|
|
}
|
|
|
|
public List<TableData> TableSheet = new();
|
|
#endif
|
|
public List<LocalizationLanguage> Languages = new();
|
|
|
|
internal LocalizationLanguage GetLanguage(string languageCode)
|
|
{
|
|
return Languages.Find(t => t.LanguageName == languageCode);
|
|
}
|
|
}
|
|
}
|