Version: 2017.3

AssetPostprocessor.OnPostprocessAssetbundleNameChanged(string, string, string)

切换到手册

描述

将资源分配给其他资源捆绑包时调用的处理程序。

Add this function in a subclass to get a notification after the assetBundle name for the asset changes.

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 + "."); } }