using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Callbacks;
using UnityEngine;
// 实现接口的方式
public class BuildReport:IPostprocessBuildWithReport,IPreprocessBuildWithReport
{
//数字越小就越先调用
public int callbackOrder =>0;
public void OnPreprocessBuild(UnityEditor.Build.Reporting.BuildReport report)
{
// build前
}
public void OnPostprocessBuild(UnityEditor.Build.Reporting.BuildReport report)
{
// build完成后
}
}
// 标签方式,两种标签都行
public class BuildReport2
{
[PostProcessBuild(2)]
public static void build(BuildTarget target, string path)
{
// build完成后
}
[PostProcessBuildAttribute(1)]
public static void build2(BuildTarget target, string path)
{
// build完成后
}
}
unity 监听Build前后事件
最新推荐文章于 2023-11-30 16:41:02 发布