Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some opt #89

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions Editor/AddressableImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAsse
{
// Skip if all imported and deleted assets are addressables configurations.
var isConfigurationPass =
(importedAssets.Length > 0 && importedAssets.All(x => x.StartsWith("Assets/AddressableAssetsData"))) &&
(deletedAssets.Length > 0 && deletedAssets.All(x => x.StartsWith("Assets/AddressableAssetsData")));
(importedAssets.Length == 0 || importedAssets.All(x => x.StartsWith("Assets/AddressableAssetsData"))) &&
(deletedAssets.Length == 0 || deletedAssets.All(x => x.StartsWith("Assets/AddressableAssetsData")));
if (isConfigurationPass)
{
return;
Expand Down Expand Up @@ -277,8 +277,11 @@ static AddressableAssetEntry CreateOrUpdateAddressableAssetEntry(
foreach (var dynamicLabel in rule.dynamicLabels)
{
var label = rule.ParseReplacement(assetPath, dynamicLabel);
settings.AddLabel(label);
entry.labels.Add(label);
if (!string.IsNullOrEmpty(label))
{
settings.AddLabel(label);
entry.labels.Add(label);
}
}
}
}
Expand Down Expand Up @@ -363,10 +366,14 @@ public static void ReimportFolders(IEnumerable<String> assetPaths, bool showConf
var filesToAdd = Directory.GetFiles(assetPath, "*", SearchOption.AllDirectories);
foreach (var file in filesToAdd)
{
var filePath = file.Replace('\\', '/');
if (filePath.Contains("~/"))
continue;

// Filter out meta and DS_Store files.
if (!IsAssetIgnored(file))
if (!IsAssetIgnored(filePath))
{
pathsToImport.Add(file.Replace('\\', '/'));
pathsToImport.Add(filePath);
ChaosVan marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down