Static utility class for importing and exporting localized data from and to CSV files. More...
Static Public Member Functions | |
static void | ExportToCSV (LocalizedStringsData data, string filePath) |
Exports LocalizedStringsData to a CSV file. | |
static void | ImportFromCSV (LocalizedStringsData data, string filePath) |
Imports LocalizedStringsData from a CSV file. | |
static void | ExportToCSV (LocalizedSpritesData data, string filePath) |
Exports LocalizedSpritesData to a CSV file using asset paths. | |
static void | ImportFromCSV (LocalizedSpritesData data, string filePath) |
Imports LocalizedSpritesData from a CSV file. Tries to resolve sprite paths. | |
static void | ExportToCSV (LocalizedTexturesData data, string filePath) |
Exports LocalizedTexturesData to a CSV file using asset paths. Each row contains a key and a list of texture asset paths per language. | |
static void | ImportFromCSV (LocalizedTexturesData data, string filePath) |
Imports LocalizedTexturesData from a CSV file. Resolves asset paths to Texture references. | |
static void | ExportToCSV (LocalizedAudioClipsData data, string filePath) |
Exports LocalizedAudioClipsData to a CSV file using asset paths. | |
static void | ImportFromCSV (LocalizedAudioClipsData data, string filePath) |
Imports LocalizedAudioClipsData from a CSV file. Tries to resolve clip paths. | |
Static Private Member Functions | |
static string | EscapeCsvField (string value) |
Escapes a CSV field (quotes, separator, line breaks). | |
static string | UnescapeCsvField (string value) |
Reverts CSV escaping on a field. | |
static string[] | ParseCsvLine (string line) |
Parses a single line of a CSV respecting quoted values. | |
static Sprite | LoadSprite (string pathOrName) |
Tries to load a Sprite from path or by searching its name in the project. | |
static AudioClip | LoadAudioClip (string pathOrName) |
Tries to load an AudioClip from path or by searching its name in the project. | |
static Texture | LoadTexture (string assetPath) |
Static Private Attributes | |
static char | separator = ';' |
Static utility class for importing and exporting localized data from and to CSV files.
This class supports the three types of localized content used in the system:
The expected CSV format includes a header with the "Key" followed by language columns. Each row represents a localized entry. In the case of sprites and audio, paths to the asset are stored and resolved using AssetDatabase.
Usage example: CSVManager.ExportToCSV(myLocalizedStringsData, "Assets/Localization/Strings.csv"); CSVManager.ImportFromCSV(myLocalizedSpritesData, "Assets/Localization/Sprites.csv");
|
staticprivate |
Escapes a CSV field (quotes, separator, line breaks).
|
static |
Exports LocalizedAudioClipsData to a CSV file using asset paths.
|
static |
Exports LocalizedSpritesData to a CSV file using asset paths.
|
static |
Exports LocalizedStringsData to a CSV file.
|
static |
Exports LocalizedTexturesData to a CSV file using asset paths. Each row contains a key and a list of texture asset paths per language.
|
static |
Imports LocalizedAudioClipsData from a CSV file. Tries to resolve clip paths.
|
static |
Imports LocalizedSpritesData from a CSV file. Tries to resolve sprite paths.
|
static |
Imports LocalizedStringsData from a CSV file.
|
static |
Imports LocalizedTexturesData from a CSV file. Resolves asset paths to Texture references.
|
staticprivate |
Tries to load an AudioClip from path or by searching its name in the project.
|
staticprivate |
Tries to load a Sprite from path or by searching its name in the project.
|
staticprivate |
|
staticprivate |
Parses a single line of a CSV respecting quoted values.
|
staticprivate |
Reverts CSV escaping on a field.
|
staticprivate |