From c4cd8d47700f9d7a0289855bd1976334ada27f40 Mon Sep 17 00:00:00 2001 From: Usevalad Buben Date: Sat, 7 Nov 2026 11:12:30 +0300 Subject: [PATCH 1/5] Regenerate on table save instead of on every table edit Co-Authored-By: Claude Opus 5.5 --- .../Assets/root/Editor/CodegenHooks.cs | 35 ++++++++----------- .../Assets/root/Editor/SettingsGui.cs | 2 +- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/Unity-Package/Assets/root/Editor/CodegenHooks.cs b/Unity-Package/Assets/root/Editor/CodegenHooks.cs index 7c99969..94eeb67 100644 --- a/Unity-Package/Assets/root/Editor/CodegenHooks.cs +++ b/Unity-Package/Assets/root/Editor/CodegenHooks.cs @@ -1,11 +1,11 @@ ο»Ώusing UnityEditor; -using UnityEditor.Localization; using UnityEngine; namespace Severnbli.LocalizationCodegen.Editor { /// - /// Coalesces localization editor events into one debounced generation pass. + /// Coalesces dirty marks into one debounced generation pass. Table edits mark the output dirty only once the + /// table assets are saved (see ), not on every in-memory edit. /// The dirty flag lives in so it survives a domain reload. /// [InitializeOnLoad] @@ -13,6 +13,7 @@ internal static class CodegenHooks { const string DirtyKey = "LocalizationCodegen.Dirty"; const string WizardShownKey = "LocalizationCodegen.WizardShown"; + const string TablesDeletedKey = "LocalizationCodegen.TablesDeleted"; const double DebounceSeconds = 0.5; @@ -24,19 +25,6 @@ static CodegenHooks() var settings = CodegenSettings.instance; settings.EnsureMigrated(); - var events = LocalizationEditorSettings.EditorEvents; - events.CollectionAdded += _ => MarkDirtyExternal(); - events.CollectionRemoved += _ => MarkDirtyExternal(); - events.CollectionModified += (_, __) => MarkDirtyExternal(); - events.TableEntryAdded += (_, __) => MarkDirtyExternal(); - events.TableEntryRemoved += (_, __) => MarkDirtyExternal(); - events.TableEntryModified += _ => MarkDirtyExternal(); - events.AssetTableEntryAdded += (_, __, ___) => MarkDirtyExternal(); - events.AssetTableEntryRemoved += (_, __, ___, ____) => MarkDirtyExternal(); - events.LocaleAdded += _ => MarkDirtyExternal(); - events.LocaleRemoved += _ => MarkDirtyExternal(); - events.LocaleSortOrderChanged += (_, __) => MarkDirtyExternal(); - if (SessionState.GetBool(DirtyKey, false)) s_LastDirtyTime = EditorApplication.timeSinceStartup; @@ -51,6 +39,13 @@ internal static void MarkDirtyExternal() s_LastDirtyTime = EditorApplication.timeSinceStartup; } + /// Marks the output stale after table collection assets were deleted, so their files go too. + internal static void MarkTablesDeleted() + { + SessionState.SetBool(TablesDeletedKey, true); + MarkDirtyExternal(); + } + static void Tick() { if (Application.isBatchMode) @@ -77,14 +72,14 @@ static void Tick() return; var settings = CodegenSettings.instance; + var tablesDeleted = SessionState.GetBool(TablesDeletedKey, false); + SessionState.SetBool(DirtyKey, false); + SessionState.SetBool(TablesDeletedKey, false); + if (!settings.SetupCompleted || !settings.AutoRegenerate) - { - SessionState.SetBool(DirtyKey, false); return; - } - SessionState.SetBool(DirtyKey, false); - CodeGenerator.Run(new GenerateOptions { IsAutomatic = true }); + CodeGenerator.Run(new GenerateOptions { IsAutomatic = true, TablesDeleted = tablesDeleted }); } static void CheckStaleness() diff --git a/Unity-Package/Assets/root/Editor/SettingsGui.cs b/Unity-Package/Assets/root/Editor/SettingsGui.cs index 25d03d3..3205a6a 100644 --- a/Unity-Package/Assets/root/Editor/SettingsGui.cs +++ b/Unity-Package/Assets/root/Editor/SettingsGui.cs @@ -31,7 +31,7 @@ internal static class Content public static readonly GUIContent AssetTables = new GUIContent("Asset Tables", "Generate classes for asset table collections. Disabling this deletes the matching generated files on the next run."); public static readonly GUIContent AutoRegenerate = new GUIContent("Regenerate On Changes", - "Automatically regenerate when table collections or entries change."); + "Automatically regenerate when table assets are saved or change on disk."); public static readonly GUIContent RegenerateSilently = new GUIContent("Silently On Settings Change", "Regenerate without asking when a setting that changes the generated code is edited. " + "Off asks first."); From 4e5492f5ca63863e13fb584e99422454e4cf107d Mon Sep 17 00:00:00 2001 From: Usevalad Buben Date: Sat, 7 Nov 2026 11:12:30 +0300 Subject: [PATCH 2/5] Delete generated files when their table collections are deleted Fixes #14 Co-Authored-By: Claude Opus 5.5 --- .../Assets/root/Editor/CodeGenerator.cs | 27 +++++++++- .../root/Editor/CodegenAssetPostprocessor.cs | 41 +++++++++++++-- .../Assets/root/Editor/CodegenSettings.cs | 3 ++ .../Assets/root/Editor/TableReader.cs | 32 +++++++++++- .../Editor/GenerationIntegrationTests.cs | 50 +++++++++++++++++++ 5 files changed, 145 insertions(+), 8 deletions(-) diff --git a/Unity-Package/Assets/root/Editor/CodeGenerator.cs b/Unity-Package/Assets/root/Editor/CodeGenerator.cs index 3df04a5..e8f863f 100644 --- a/Unity-Package/Assets/root/Editor/CodeGenerator.cs +++ b/Unity-Package/Assets/root/Editor/CodeGenerator.cs @@ -22,6 +22,12 @@ public sealed class GenerateOptions /// Allow a run inside -batchmode. public bool AllowInBatchMode; + + /// + /// The run follows the deletion of table collection assets, so collections that are gone (or lost their + /// shared table data) were removed on purpose and their generated files are deleted, even the last one. + /// + public bool TablesDeleted; } /// Result of one generation run. @@ -103,7 +109,7 @@ public static GenerateResult Run(GenerateOptions options) WarnAboutOwningAssembly(folder, emitOptions, settings, result); var reader = new TableReader(emitOptions); - var read = reader.Read(settings.GenerateStringTables, settings.GenerateAssetTables); + var read = reader.Read(settings.GenerateStringTables, settings.GenerateAssetTables, options.TablesDeleted); result.Warnings.AddRange(read.Warnings); result.Total = read.Models.Count; @@ -155,7 +161,8 @@ public static GenerateResult Run(GenerateOptions options) var allowCleanup = read.Failed == 0; - if (read.Models.Count == 0 && HasPreviousOutput(settings, folderFull)) + // A deliberate deletion of the last collections needs no confirmation: deleting the tables was it. + if (read.Models.Count == 0 && HasPreviousOutput(settings, folderFull) && !options.TablesDeleted) { if (options.IsAutomatic || !options.PromptOnMassDeletion || Application.isBatchMode) { @@ -253,6 +260,10 @@ public static GenerateResult Run(GenerateOptions options) .Select(p => p.Key + "|" + p.Value) .ToArray(); settings.LastModelHash = HashModels(read.Models, emitOptions); + settings.TableAssetPaths = read.AssetPaths + .Distinct(StringComparer.Ordinal) + .OrderBy(p => p, StringComparer.Ordinal) + .ToArray(); settings.SaveSettings(); } finally @@ -648,6 +659,18 @@ public static string ComputeModelHash() var options = BuildEmitOptions(settings); var reader = new TableReader(options); var read = reader.Read(settings.GenerateStringTables, settings.GenerateAssetTables); + + // Projects generated by older versions have no table paths yet; without them a deletion of the + // tables would not be recognised before the next generation run. + if (settings.TableAssetPaths.Length == 0 && read.AssetPaths.Count > 0) + { + settings.TableAssetPaths = read.AssetPaths + .Distinct(StringComparer.Ordinal) + .OrderBy(p => p, StringComparer.Ordinal) + .ToArray(); + settings.SaveSettings(); + } + CodeEmitter.AssignClassNames(read.Models, options); return HashModels(read.Models, options); } diff --git a/Unity-Package/Assets/root/Editor/CodegenAssetPostprocessor.cs b/Unity-Package/Assets/root/Editor/CodegenAssetPostprocessor.cs index b4bd5fe..2ca6d71 100644 --- a/Unity-Package/Assets/root/Editor/CodegenAssetPostprocessor.cs +++ b/Unity-Package/Assets/root/Editor/CodegenAssetPostprocessor.cs @@ -6,7 +6,8 @@ namespace Severnbli.LocalizationCodegen.Editor { /// - /// Detects table assets changed outside the editor (git pull, merge, revert) and marks the output stale. + /// Detects saved or imported table assets (table save in the editor, git pull, merge, revert) and marks the + /// output stale. This is the only trigger for automatic regeneration on table changes. /// internal sealed class CodegenAssetPostprocessor : AssetPostprocessor { @@ -22,10 +23,14 @@ static void OnPostprocessAllAssets( if (!settings.SetupCompleted || !settings.AutoRegenerate) return; - if (ContainsLocalizationAsset(importedAssets) || - ContainsLocalizationAsset(movedAssets) || - ContainsAssetPath(deletedAssets) || - ContainsAssetPath(movedFromAssetPaths)) + if (ContainsTableAsset(deletedAssets, settings.TableAssetPaths)) + { + CodegenHooks.MarkTablesDeleted(); + } + else if (ContainsLocalizationAsset(importedAssets) || + ContainsLocalizationAsset(movedAssets) || + ContainsAssetPath(deletedAssets) || + ContainsAssetPath(movedFromAssetPaths)) { CodegenHooks.MarkDirtyExternal(); } @@ -59,6 +64,32 @@ static bool ContainsLocalizationAsset(string[] paths) return false; } + /// + /// True when a deleted path is a collection or shared table data asset the last run read, or a folder that + /// held one. Deleted assets can no longer be loaded, so their type is known only from that list. + /// + static bool ContainsTableAsset(string[] deletedPaths, string[] tableAssetPaths) + { + if (deletedPaths == null || tableAssetPaths == null || tableAssetPaths.Length == 0) + return false; + + foreach (var deleted in deletedPaths) + { + if (string.IsNullOrEmpty(deleted)) + continue; + var folder = deleted.TrimEnd('/') + "/"; + foreach (var table in tableAssetPaths) + { + if (string.IsNullOrEmpty(table)) + continue; + if (string.Equals(table, deleted, StringComparison.Ordinal) || + table.StartsWith(folder, StringComparison.Ordinal)) + return true; + } + } + return false; + } + static bool ContainsAssetPath(string[] paths) { if (paths == null) diff --git a/Unity-Package/Assets/root/Editor/CodegenSettings.cs b/Unity-Package/Assets/root/Editor/CodegenSettings.cs index b66c99a..d56231f 100644 --- a/Unity-Package/Assets/root/Editor/CodegenSettings.cs +++ b/Unity-Package/Assets/root/Editor/CodegenSettings.cs @@ -22,6 +22,8 @@ public sealed class CodegenSettings : ScriptableSingleton [SerializeField] private string lastOutputFolder; [SerializeField] private string[] generatedPaths = new string[0]; [SerializeField] private string lastAsmdefPath; + // Collection and shared table data assets seen by the last run, to recognise their deletion. + [SerializeField] private string[] tableAssetPaths = new string[0]; // Incremental generation (B8) and staleness (A6). [SerializeField] private string lastModelHash; @@ -57,6 +59,7 @@ public sealed class CodegenSettings : ScriptableSingleton public string LastOutputFolder { get => lastOutputFolder; set => lastOutputFolder = value; } public string[] GeneratedPaths { get => generatedPaths ?? (generatedPaths = new string[0]); set => generatedPaths = value; } public string LastAsmdefPath { get => lastAsmdefPath; set => lastAsmdefPath = value; } + public string[] TableAssetPaths { get => tableAssetPaths ?? (tableAssetPaths = new string[0]); set => tableAssetPaths = value; } public string LastModelHash { get => lastModelHash; set => lastModelHash = value; } public string[] CollectionHashes { get => collectionHashes ?? (collectionHashes = new string[0]); set => collectionHashes = value; } diff --git a/Unity-Package/Assets/root/Editor/TableReader.cs b/Unity-Package/Assets/root/Editor/TableReader.cs index 0b2a898..3c1f21c 100644 --- a/Unity-Package/Assets/root/Editor/TableReader.cs +++ b/Unity-Package/Assets/root/Editor/TableReader.cs @@ -17,6 +17,9 @@ internal sealed class ReaderResult public readonly List Models = new List(); public readonly List Warnings = new List(); public int Failed; + + /// Asset paths of the collections read and of their shared table data. + public readonly List AssetPaths = new List(); } /// @@ -37,7 +40,11 @@ public TableReader(EmitOptions options) CollectGlobalVariableGroups(); } - public ReaderResult Read(bool readStringTables, bool readAssetTables) + /// + /// Table assets were just deleted, so a collection without shared table data is being removed: it is skipped + /// as if it no longer existed instead of counting as a failed read that would block cleanup. + /// + public ReaderResult Read(bool readStringTables, bool readAssetTables, bool tablesDeleted = false) { var result = new ReaderResult(); @@ -45,6 +52,9 @@ public ReaderResult Read(bool readStringTables, bool readAssetTables) { foreach (var collection in Sort(LocalizationEditorSettings.GetStringTableCollections())) { + AddAssetPaths(collection, result); + if (tablesDeleted && collection.SharedData == null) + continue; try { result.Models.Add(ReadCollection(collection, false, result.Warnings)); @@ -61,6 +71,9 @@ public ReaderResult Read(bool readStringTables, bool readAssetTables) { foreach (var collection in Sort(LocalizationEditorSettings.GetAssetTableCollections())) { + AddAssetPaths(collection, result); + if (tablesDeleted && collection.SharedData == null) + continue; try { result.Models.Add(ReadCollection(collection, true, result.Warnings)); @@ -76,6 +89,23 @@ public ReaderResult Read(bool readStringTables, bool readAssetTables) return result; } + static void AddAssetPaths(LocalizationTableCollection collection, ReaderResult result) + { + try + { + var path = AssetDatabase.GetAssetPath(collection); + if (!string.IsNullOrEmpty(path)) + result.AssetPaths.Add(path); + var sharedPath = collection.SharedData != null ? AssetDatabase.GetAssetPath(collection.SharedData) : null; + if (!string.IsNullOrEmpty(sharedPath)) + result.AssetPaths.Add(sharedPath); + } + catch + { + // The paths only help to recognise deletions; a broken collection is reported by the read itself. + } + } + static IEnumerable Sort(IEnumerable collections) { return (collections ?? Enumerable.Empty()) diff --git a/Unity-Package/Assets/root/Tests/Editor/GenerationIntegrationTests.cs b/Unity-Package/Assets/root/Tests/Editor/GenerationIntegrationTests.cs index 118e7a7..ca3a41d 100644 --- a/Unity-Package/Assets/root/Tests/Editor/GenerationIntegrationTests.cs +++ b/Unity-Package/Assets/root/Tests/Editor/GenerationIntegrationTests.cs @@ -29,6 +29,7 @@ public class GenerationIntegrationTests string m_LastOutputFolder; string[] m_GeneratedPaths; string[] m_CollectionHashes; + string[] m_TableAssetPaths; string m_LastModelHash; [SetUp] @@ -47,6 +48,7 @@ public void SetUp() m_LastOutputFolder = m_Settings.LastOutputFolder; m_GeneratedPaths = m_Settings.GeneratedPaths; m_CollectionHashes = m_Settings.CollectionHashes; + m_TableAssetPaths = m_Settings.TableAssetPaths; m_LastModelHash = m_Settings.LastModelHash; if (AssetDatabase.IsValidFolder(TestRoot)) @@ -87,6 +89,7 @@ public void TearDown() m_Settings.LastOutputFolder = m_LastOutputFolder; m_Settings.GeneratedPaths = m_GeneratedPaths; m_Settings.CollectionHashes = m_CollectionHashes; + m_Settings.TableAssetPaths = m_TableAssetPaths; m_Settings.LastModelHash = m_LastModelHash; m_Settings.SaveSettings(); @@ -171,6 +174,53 @@ public void RemovedCollection_DropsItsStoredHash() System.Array.FindAll(m_Settings.CollectionHashes, h => h.StartsWith("S|RemovedCollection|"))); } + [Test] + public void Run_RecordsTheCollectionAndSharedDataPaths() + { + var run = CodeGenerator.Run(new GenerateOptions { PromptOnMassDeletion = false, AllowInBatchMode = true }); + Assert.IsTrue(run.Success, run.Error); + + CollectionAssert.Contains(m_Settings.TableAssetPaths, AssetDatabase.GetAssetPath(m_Collection)); + CollectionAssert.Contains(m_Settings.TableAssetPaths, AssetDatabase.GetAssetPath(m_Collection.SharedData)); + } + + [Test] + public void DeletedCollection_RemovesItsFile_EvenWhenItWasTheLastOne() + { + var firstRun = CodeGenerator.Run(new GenerateOptions { PromptOnMassDeletion = false, AllowInBatchMode = true }); + Assert.IsTrue(firstRun.Success, firstRun.Error); + + var path = TestRoot + "/OutA/CodegenIntegration.g.cs"; + Assert.IsTrue(File.Exists(path)); + + AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(m_Collection.SharedData)); + AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(m_Collection)); + + var secondRun = CodeGenerator.Run(new GenerateOptions + { + IsAutomatic = true, TablesDeleted = true, AllowInBatchMode = true + }); + Assert.IsTrue(secondRun.Success, secondRun.Error); + Assert.IsFalse(File.Exists(path), "The file of a deleted collection must be removed."); + } + + [Test] + public void CollectionWithDeletedSharedData_RemovesItsFile() + { + var firstRun = CodeGenerator.Run(new GenerateOptions { PromptOnMassDeletion = false, AllowInBatchMode = true }); + Assert.IsTrue(firstRun.Success, firstRun.Error); + + var path = TestRoot + "/OutA/CodegenIntegration.g.cs"; + AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(m_Collection.SharedData)); + + var secondRun = CodeGenerator.Run(new GenerateOptions + { + IsAutomatic = true, TablesDeleted = true, AllowInBatchMode = true + }); + Assert.IsTrue(secondRun.Success, secondRun.Error); + Assert.IsFalse(File.Exists(path), "A collection that lost its shared table data is being deleted."); + } + [Test] public void UniTaskOption_EmitsAsyncMembersOnlyWhenTheAddOnIsCompiled() { From e91fdb9ea4808d45531e3b9812e591fc2df27317 Mon Sep 17 00:00:00 2001 From: Usevalad Buben Date: Sat, 7 Nov 2026 11:12:30 +0300 Subject: [PATCH 3/5] Bump version to 1.4.0 Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 11 +++++++++++ .../Localization Codegen Installer/Installer.cs | 2 +- README.md | 8 ++++---- Unity-Package/Assets/root/README.md | 8 ++++---- Unity-Package/Assets/root/package.json | 2 +- 5 files changed, 21 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e5dc21..6ff8a26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [1.4.0] - 2026-11-07 + +### Fixed +- Deleting table collection assets now always deletes their generated files (#14). Before, the files stayed when + the last collection was deleted, or when the collection assets were deleted in an order that left a collection + without its shared table data. + +### Changed +- Table edits (adding, removing or editing keys, entries and collections) no longer regenerate immediately; the + code regenerates when the table is saved (**File > Save Project** or Ctrl+S). + ## [1.3.3] - 2026-10-28 ### Added diff --git a/Installer/Assets/Editor/Localization Codegen Installer/Installer.cs b/Installer/Assets/Editor/Localization Codegen Installer/Installer.cs index 34ef095..d940531 100644 --- a/Installer/Assets/Editor/Localization Codegen Installer/Installer.cs +++ b/Installer/Assets/Editor/Localization Codegen Installer/Installer.cs @@ -16,7 +16,7 @@ namespace Severnbli.LocalizationCodegen.Installer public static partial class Installer { public const string PackageId = "com.severnbli.localization-codegen"; - public const string Version = "1.3.3"; + public const string Version = "1.4.0"; static Installer() { diff --git a/README.md b/README.md index e965c77..dfb9471 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ label.text = Ui.HelloWorld; | πŸ’¬ **Smart strings** | Entries with placeholders become methods with typed positional and named parameters | | πŸ”— **Reference members** | Optional `Ref` class with `LocalizedString` / `LocalizedAsset` references that follow locale changes | | ⚑ **UniTask** | Optional `…Async` members returning `UniTask`, with cancellation | -| πŸ” **Automatic regeneration** | Debounced regeneration after table edits, including changes pulled from version control | +| πŸ” **Automatic regeneration** | Regeneration when tables are saved, including changes pulled from version control | | πŸ§ͺ **CI ready** | Batch mode entry points to regenerate, or to fail when generated code is out of date | | πŸͺ„ **First-run wizard** | A setup wizard opens after the package is first imported | @@ -79,7 +79,7 @@ label.text = Ui.HelloWorld; label.text = Ui.HelloWorld; ``` -Edit your tables as usual – the classes regenerate on their own. +Edit your tables as usual – the classes regenerate when you save them. ## Installation @@ -134,7 +134,7 @@ Add the scoped registry and the dependency to `Packages/manifest.json`: } ], "dependencies": { - "com.severnbli.localization-codegen": "1.3.3" + "com.severnbli.localization-codegen": "1.4.0" } } ``` @@ -378,7 +378,7 @@ Open **Project Settings > Localization Codegen**, or **Window > Localization Cod | Output Folder | `Assets/Generated/Localization` | Must be inside `Assets`. Changing it removes generated files from the old folder. Inside another `.asmdef`, you are offered to add the references the code needs. | | String Tables | on | Generate classes for string table collections. Disabling deletes the matching files on the next run. | | Asset Tables | on | Generate classes for asset table collections. Disabling deletes the matching files on the next run. | -| Regenerate On Changes | on | Debounced automatic regeneration after table edits and external (VCS) changes. | +| Regenerate On Changes | on | Automatic regeneration when table assets are saved (**File > Save Project** or Ctrl+S) and after external (VCS) changes. | | Silently On Settings Change | off | Regenerate without asking when a setting that changes the generated code is edited. Off asks first. Needs **Regenerate On Changes**. | | On Metadata Edit | off | Regenerate after every edit of the Smart Parameter Types metadata. Off regenerates when the table is saved. Needs **Regenerate On Changes**. | | Generate Reference Members | off | Emit the nested [`Ref` class](#reference-members). | diff --git a/Unity-Package/Assets/root/README.md b/Unity-Package/Assets/root/README.md index e965c77..dfb9471 100644 --- a/Unity-Package/Assets/root/README.md +++ b/Unity-Package/Assets/root/README.md @@ -58,7 +58,7 @@ label.text = Ui.HelloWorld; | πŸ’¬ **Smart strings** | Entries with placeholders become methods with typed positional and named parameters | | πŸ”— **Reference members** | Optional `Ref` class with `LocalizedString` / `LocalizedAsset` references that follow locale changes | | ⚑ **UniTask** | Optional `…Async` members returning `UniTask`, with cancellation | -| πŸ” **Automatic regeneration** | Debounced regeneration after table edits, including changes pulled from version control | +| πŸ” **Automatic regeneration** | Regeneration when tables are saved, including changes pulled from version control | | πŸ§ͺ **CI ready** | Batch mode entry points to regenerate, or to fail when generated code is out of date | | πŸͺ„ **First-run wizard** | A setup wizard opens after the package is first imported | @@ -79,7 +79,7 @@ label.text = Ui.HelloWorld; label.text = Ui.HelloWorld; ``` -Edit your tables as usual – the classes regenerate on their own. +Edit your tables as usual – the classes regenerate when you save them. ## Installation @@ -134,7 +134,7 @@ Add the scoped registry and the dependency to `Packages/manifest.json`: } ], "dependencies": { - "com.severnbli.localization-codegen": "1.3.3" + "com.severnbli.localization-codegen": "1.4.0" } } ``` @@ -378,7 +378,7 @@ Open **Project Settings > Localization Codegen**, or **Window > Localization Cod | Output Folder | `Assets/Generated/Localization` | Must be inside `Assets`. Changing it removes generated files from the old folder. Inside another `.asmdef`, you are offered to add the references the code needs. | | String Tables | on | Generate classes for string table collections. Disabling deletes the matching files on the next run. | | Asset Tables | on | Generate classes for asset table collections. Disabling deletes the matching files on the next run. | -| Regenerate On Changes | on | Debounced automatic regeneration after table edits and external (VCS) changes. | +| Regenerate On Changes | on | Automatic regeneration when table assets are saved (**File > Save Project** or Ctrl+S) and after external (VCS) changes. | | Silently On Settings Change | off | Regenerate without asking when a setting that changes the generated code is edited. Off asks first. Needs **Regenerate On Changes**. | | On Metadata Edit | off | Regenerate after every edit of the Smart Parameter Types metadata. Off regenerates when the table is saved. Needs **Regenerate On Changes**. | | Generate Reference Members | off | Emit the nested [`Ref` class](#reference-members). | diff --git a/Unity-Package/Assets/root/package.json b/Unity-Package/Assets/root/package.json index 0443c68..90e1a0b 100644 --- a/Unity-Package/Assets/root/package.json +++ b/Unity-Package/Assets/root/package.json @@ -10,7 +10,7 @@ "Generation", "Code Generation" ], - "version": "1.3.3", + "version": "1.4.0", "unity": "2021.3", "description": "C# classes and properties generator from Unity Localization tables", "documentationUrl": "https://github.com/Severnbli/localization-codegen/blob/main/README.md", From d01a8707df8ad9116c7b0f740f8f083af628d478 Mon Sep 17 00:00:00 2001 From: Usevalad Buben Date: Sat, 7 Nov 2026 11:13:24 +0300 Subject: [PATCH 4/5] Set version to 1.3.4 Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 2 +- .../Assets/Editor/Localization Codegen Installer/Installer.cs | 2 +- README.md | 2 +- Unity-Package/Assets/root/README.md | 2 +- Unity-Package/Assets/root/package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ff8a26..2103b4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [1.4.0] - 2026-11-07 +## [1.3.4] - 2026-11-07 ### Fixed - Deleting table collection assets now always deletes their generated files (#14). Before, the files stayed when diff --git a/Installer/Assets/Editor/Localization Codegen Installer/Installer.cs b/Installer/Assets/Editor/Localization Codegen Installer/Installer.cs index d940531..d5260fc 100644 --- a/Installer/Assets/Editor/Localization Codegen Installer/Installer.cs +++ b/Installer/Assets/Editor/Localization Codegen Installer/Installer.cs @@ -16,7 +16,7 @@ namespace Severnbli.LocalizationCodegen.Installer public static partial class Installer { public const string PackageId = "com.severnbli.localization-codegen"; - public const string Version = "1.4.0"; + public const string Version = "1.3.4"; static Installer() { diff --git a/README.md b/README.md index dfb9471..c016c91 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ Add the scoped registry and the dependency to `Packages/manifest.json`: } ], "dependencies": { - "com.severnbli.localization-codegen": "1.4.0" + "com.severnbli.localization-codegen": "1.3.4" } } ``` diff --git a/Unity-Package/Assets/root/README.md b/Unity-Package/Assets/root/README.md index dfb9471..c016c91 100644 --- a/Unity-Package/Assets/root/README.md +++ b/Unity-Package/Assets/root/README.md @@ -134,7 +134,7 @@ Add the scoped registry and the dependency to `Packages/manifest.json`: } ], "dependencies": { - "com.severnbli.localization-codegen": "1.4.0" + "com.severnbli.localization-codegen": "1.3.4" } } ``` diff --git a/Unity-Package/Assets/root/package.json b/Unity-Package/Assets/root/package.json index 90e1a0b..ad08049 100644 --- a/Unity-Package/Assets/root/package.json +++ b/Unity-Package/Assets/root/package.json @@ -10,7 +10,7 @@ "Generation", "Code Generation" ], - "version": "1.4.0", + "version": "1.3.4", "unity": "2021.3", "description": "C# classes and properties generator from Unity Localization tables", "documentationUrl": "https://github.com/Severnbli/localization-codegen/blob/main/README.md", From 64b61a82c6db002aa5b8ac49a9346a0b3e3f2e7d Mon Sep 17 00:00:00 2001 From: Usevalad Buben Date: Sat, 7 Nov 2026 11:15:17 +0300 Subject: [PATCH 5/5] Copy CHANGELOG into the package Co-Authored-By: Claude Opus 5.5 --- Unity-Package/Assets/root/CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Unity-Package/Assets/root/CHANGELOG.md b/Unity-Package/Assets/root/CHANGELOG.md index 1e5dc21..2103b4f 100644 --- a/Unity-Package/Assets/root/CHANGELOG.md +++ b/Unity-Package/Assets/root/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [1.3.4] - 2026-11-07 + +### Fixed +- Deleting table collection assets now always deletes their generated files (#14). Before, the files stayed when + the last collection was deleted, or when the collection assets were deleted in an order that left a collection + without its shared table data. + +### Changed +- Table edits (adding, removing or editing keys, entries and collections) no longer regenerate immediately; the + code regenerates when the table is saved (**File > Save Project** or Ctrl+S). + ## [1.3.3] - 2026-10-28 ### Added