将资源分配给其他资源捆绑包时调用的处理程序。
将此函数添加到一个子类中,以在资源的 assetBundle 名称发生更改后获取通知。
using UnityEngine; using UnityEditor;
public class MyAllPostprocessor : AssetPostprocessor { public void OnPostprocessAssetbundleNameChanged(string assetPath, string previousAssetBundleName, string newAssetBundleName) { Debug.Log("Asset " + assetPath + " has been moved from assetBundle " + previousAssetBundleName + " to assetBundle " + newAssetBundleName + "."); } }