Skip to content

Commit

Permalink
fix: shaders for SoftMask are not automatically included
Browse files Browse the repository at this point in the history
close #177, close #178
  • Loading branch information
mob-sakai committed Jul 25, 2024
1 parent 731f137 commit 3a37659
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions Packages/src/Runtime/ProjectSettings/UISoftMaskProjectSettings.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#pragma warning disable CS0414
using System.Linq;
using Coffee.UISoftMaskInternal;
using UnityEditor;
using UnityEngine;
using UnityEngine.Serialization;
using UnityEngine.UI;
#if UNITY_MODULE_VR
using UnityEngine.XR;
#endif
#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
#endif

namespace Coffee.UISoftMask
{
Expand Down Expand Up @@ -197,6 +200,16 @@ private static SettingsProvider CreateSettingsProvider()
{
return new PreloadedProjectSettingsProvider("Project/UI/Soft Mask");
}

private class PreprocessBuildWithReport : IPreprocessBuildWithReport
{
int IOrderedCallback.callbackOrder => 0;

void IPreprocessBuildWithReport.OnPreprocessBuild(BuildReport report)
{
instance.ReloadShaders(false);
}
}
#endif
}
}

0 comments on commit 3a37659

Please sign in to comment.