static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { for (int i = 0; i < importedAssets.Length; i++) { string path = importedAssets[i]; string abName; Debug.Log("importAsset:" + path); if (EditorConfig.TryGetAssetBundleName(path, out abName)) { AssetImporter importer = AssetImporter.GetAtPath(path); if (!importer.assetBundleName.Equals(abName)) { importer.assetBundleName = abName; Debug.LogFormat("path={0} abName={1}", path, abName); } } } for (int i = 0; i < movedAssets.Length; i++) { string moveFromPath = movedFromAssetPaths[i]; string moveToPath = movedAssets[i]; string abName; Debug.LogFormat("movedAsset {0} => {1}", moveFromPath, moveToPath); if (EditorConfig.TryGetAssetBundleName(moveToPath, out abName)) { AssetImporter importer = AssetImporter.GetAtPath(moveToPath); if (!importer.assetBundleName.EndsWith(abName)) { importer.assetBundleName = abName; Debug.LogFormat("path={0} abName={1}", moveToPath, abName); } } else { if (EditorConfig.TryGetAssetBundleName(moveFromPath, out abName)) { AssetImporter importer = AssetImporter.GetAtPath(moveToPath); importer.assetBundleName = null; Debug.LogFormat("path={0} set assetBundleName to null", moveToPath); } } } }