24 lines
812 B
C#
24 lines
812 B
C#
using UnityEditor.Build;
|
|
using UnityEditor.Build.Reporting;
|
|
using UnityEditor.XR.ARSubsystems;
|
|
using UnityEngine.XR.ARKit;
|
|
|
|
namespace UnityEditor.XR.ARKit
|
|
{
|
|
class NoniOSBuildProcessor : IPreprocessBuildWithReport
|
|
{
|
|
public int callbackOrder => 0;
|
|
|
|
public void OnPreprocessBuild(BuildReport report)
|
|
{
|
|
if (report.summary.platform != BuildTarget.iOS)
|
|
{
|
|
// Sometimes (e.g., build failure), the shader can get "stuck" in the Preloaded Assets array.
|
|
// Make sure that if we are not building for iOS, we remove that shader.
|
|
foreach (var backgroundShaderName in ARKitCameraSubsystem.backgroundShaderNames)
|
|
BuildHelper.RemoveShaderFromProject(backgroundShaderName);
|
|
}
|
|
}
|
|
}
|
|
}
|