Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kankikuchi committed Dec 12, 2019
2 parents bd03c1e + 08d487f commit 65073e6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 6 additions & 3 deletions Assets/AudioManager_KanKikuchi/Editor/AudioPathCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ private static void OnPostprocessAllAssets(string[] importedAssets, string[] del
return;
}

List<string[]> assetsList = new List<string[]>() {
importedAssets, deletedAssets, movedAssets, movedFromAssetPaths
List<List<string>> assetsList = new List<List<string>>() {
importedAssets.Select(path => path.Replace("\\", "/")).ToList(),
deletedAssets.Select(path => path.Replace("\\", "/")).ToList(),
movedAssets.Select(path => path.Replace("\\", "/")).ToList(),
movedFromAssetPaths.Select(path => path.Replace("\\", "/")).ToList(),
};

if (ExistsPathInAssets(assetsList, BGM_DIRECTORY_PATH)) {
Expand All @@ -41,7 +44,7 @@ private static void OnPostprocessAllAssets(string[] importedAssets, string[] del
}

//入力されたassetsのパスの中に、指定したパスが含まれるものが一つでもあるか
private static bool ExistsPathInAssets(List<string[]> assetPathsList, string targetPath) {
private static bool ExistsPathInAssets(List<List<string>> assetPathsList, string targetPath) {
return assetPathsList
.Any(assetPaths => assetPaths
.Any(assetPath => assetPath
Expand Down
8 changes: 6 additions & 2 deletions Assets/AudioManager_KanKikuchi/Editor/AudioPostProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ private static void OnPostprocessAllAssets(string[] importedAssets, string[] del
var targetBGMPathList = new List<string>();
var targetSEPathList = new List<string>();

foreach (var path in importedAssets) {
foreach (var importedAssetPath in importedAssets) {
var path = importedAssetPath.Replace("\\", "/");

if (path.Contains(bgmDirectoryPath)) {
targetBGMPathList.Add(path);
}
Expand All @@ -35,7 +37,9 @@ private static void OnPostprocessAllAssets(string[] importedAssets, string[] del
}
}

foreach (var path in movedAssets) {
foreach (var movedAssetPath in movedAssets) {
var path = movedAssetPath.Replace("\\", "/");

if (path.Contains(bgmDirectoryPath) && !targetBGMPathList.Contains(path)) {
targetBGMPathList.Add(path);
}
Expand Down

0 comments on commit 65073e6

Please sign in to comment.