31 lines
908 B
C#
31 lines
908 B
C#
using Logic.Config;
|
|
using UnityEditor;
|
|
using UnityEditor.Build;
|
|
using UnityEditor.Build.Reporting;
|
|
using UnityEngine;
|
|
|
|
namespace Logic.Editor
|
|
{
|
|
public class CustomBuildProcessor : IPreprocessBuildWithReport, IPostprocessBuildWithReport
|
|
{
|
|
public int callbackOrder => 0;
|
|
|
|
public void OnPreprocessBuild(BuildReport report)
|
|
{
|
|
// 获取版本配置
|
|
var path = "Assets/Resources/DataAssets/VersionConfig.asset";
|
|
var asset = AssetDatabase.LoadAssetAtPath<VersionConfig>(path);
|
|
|
|
if (asset != null)
|
|
{
|
|
// 设置exe文件名
|
|
PlayerSettings.productName = $"TOHOTOPIA v{asset.CurVersionInfo.FullVersion}";
|
|
}
|
|
}
|
|
|
|
public void OnPostprocessBuild(BuildReport report)
|
|
{
|
|
PlayerSettings.productName = $"TOHOTOPIA";
|
|
}
|
|
}
|
|
} |