diff --git a/Packages/src/Runtime/ProjectSettings/UISoftMaskProjectSettings.cs b/Packages/src/Runtime/ProjectSettings/UISoftMaskProjectSettings.cs index 7202771..8c6ea1d 100644 --- a/Packages/src/Runtime/ProjectSettings/UISoftMaskProjectSettings.cs +++ b/Packages/src/Runtime/ProjectSettings/UISoftMaskProjectSettings.cs @@ -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 { @@ -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 } }