您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
32 行
1.3 KiB
32 行
1.3 KiB
using UnityEditor;
|
|
using UnityEditor.Build;
|
|
using UnityEditor.Build.Reporting;
|
|
using UnityEngine;
|
|
|
|
class HDRPCustomBuildProcessor : IPreprocessBuildWithReport
|
|
{
|
|
public int callbackOrder { get { return 0; } }
|
|
|
|
public void OnPreprocessBuild(BuildReport report)
|
|
{
|
|
// Note: If you add new platform in this function, think about adding support in IsSupportedPlatform() function in HDRenderPipeline.cs
|
|
|
|
// If platform is supported all good
|
|
if (report.summary.platform == BuildTarget.StandaloneWindows ||
|
|
report.summary.platform == BuildTarget.StandaloneWindows64 ||
|
|
report.summary.platform == BuildTarget.StandaloneLinux64 ||
|
|
report.summary.platform == BuildTarget.StandaloneLinuxUniversal ||
|
|
report.summary.platform == BuildTarget.StandaloneOSX ||
|
|
report.summary.platform == BuildTarget.XboxOne ||
|
|
report.summary.platform == BuildTarget.PS4 ||
|
|
report.summary.platform == BuildTarget.Switch)
|
|
{
|
|
return ;
|
|
}
|
|
|
|
string msg = "The platform " + report.summary.platform.ToString() + " is not supported with Hight Definition Render Pipeline";
|
|
|
|
// Throw an exception to stop the build
|
|
throw new BuildFailedException(msg);
|
|
}
|
|
}
|