有时候我们制作工具需要在打包前与打包后做一些处理,可以用以下代码加入逻辑解决
public class BuildSetting : IPreprocessBuildWithReport, IPostprocessBuildWithReport { public int callbackOrder => 0; public void OnPreprocessBuild(BuildReport report) { Debug.Log("打包前"); } public void OnPostprocessBuild(BuildReport report) { Debug.Log("打包后"); } }