在build之前
//支持5.6及其以上版本
using UnityEditor;
using UnityEditor.Build;
class CustomBuildProcessor : IPreprocessBuild
{
public int callbackOrder { get { return 0; } } //越小优先级越高
public void OnPreprocessBuild(BuildTarget target, string path)
{
//do sth
}
}
在build之后
[UnityEditor.Callbacks.PostProcessBuild()] //默认不填为最优先
public static void Check(BuildTarget target, string pathToBuiltProject)
{
//do sth
}