Version: 5.6

IPreprocessBuild.OnPreprocessBuild

切换到手册
public void OnPreprocessBuild (BuildTarget target, string path);

描述

在构建开始之前实现此函数以接收回调。

using UnityEditor;
using UnityEditor.Build;
class MyCustomBuildProcessor : IPreprocessBuild
{
    public int CallbackOrder { get { return 0; } }
    public void OnPreprocessBuild(BuildTarget target, string path)
    {
        Debug.Log("MyCustomBuildProcessor.OnPreprocessBuild for target " + target + " at path " + path);
    }
}