Skip to content

Commit

Permalink
asset add wizard now matches documented behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
McJones committed Sep 22, 2023
1 parent 03d1665 commit 9049c3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Dialogue Runner will now better wait for line providers to be ready before requesting lines
- This does have the potential issue of long load times for some larger nodes, in those cases we suggest you preload more lines using `GetLineIDsForNodes` on `YarnProject`
- `UnityLocalisedLineProvider` can now have it's default setting of removing unused assets disabled, this is useful when caching multiple nodes worth of assets
- Add Assets to Asset Table Collection Wizard now correctly prepends `line:` to the key to match the documented behaviour.

### Removed

Expand Down
8 changes: 5 additions & 3 deletions Editor/Editors/AddAssetsToAssetTableCollectionWizard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,17 @@ private void AddAssets()

var allFiles = Directory.EnumerateFiles(path, "*", SearchOption.AllDirectories).Where(path => !path.EndsWith(".meta"));

foreach (var file in allFiles) {
foreach (var file in allFiles)
{
var asset = AssetDatabase.LoadAssetAtPath(file, assetType);

if (asset == null) {
if (asset == null)
{
// Not the type of asset we're looking for
continue;
}

var keyName = Path.GetFileNameWithoutExtension(file);
var keyName = $"line:{Path.GetFileNameWithoutExtension(file)}";

assetTableCollection.AddAssetToTable(locale.Identifier, keyName, asset);

Expand Down

0 comments on commit 9049c3f

Please sign in to comment.