public class BuildAfter:Editor
{
/// <summary>
/// 程序打包完成后执行的回调
/// </summary>
/// <param name="target"></param>
/// <param name="pathToBuiltProject"></param>
[PostProcessBuild(1)]
public static void AfterBuild(BuildTarget target, string pathToBuiltProject)
{
Debug.Log("Build Success 输出平台: " + target + " 输出路径: " + pathToBuiltProject);
//判断平台
if (target == BuildTarget.WebGL)
{
//读取源文件路径
string sourcePath = Application.dataPath + "/BuildAfterFiles/index.html";
ReplaceProductName(sourcePath, pathToBuiltProject + "/index.html",PlayerSettings.productName);
Debug.Log(string.Format("写入ProductName,sourcePath={0},bulidPath={1}", sourcePath, pathToBuiltProject));
}
}
}
Unity打包后事件调用记录
猜你喜欢
转载自blog.csdn.net/chillxiaohan/article/details/124146953
今日推荐
周排行