From c1c57a06cf3e3c937ac52e0e23ef2ddeae45de7b Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 29 六月 2026 19:32:40 +0800
Subject: [PATCH] 0312 安卓跳过unitylogo 恢复

---
 Assets/Launch/SkipUnityLogo/Script/SkipUnityLogo.cs |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/Assets/Launch/SkipUnityLogo/Script/SkipUnityLogo.cs b/Assets/Launch/SkipUnityLogo/Script/SkipUnityLogo.cs
index cb68969..8065332 100644
--- a/Assets/Launch/SkipUnityLogo/Script/SkipUnityLogo.cs
+++ b/Assets/Launch/SkipUnityLogo/Script/SkipUnityLogo.cs
@@ -9,6 +9,7 @@
     [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
     private static void CancelSplashScreen()
     {
+#if UNITY_IOS
         // iOS 16+ 涓� Task.Run 鍦� BeforeSplashScreen 闃舵鍙兘鏃犳硶鍙婃椂璋冨害锛�
         // 鏀圭敤鍚屾璋冪敤锛岀‘淇� SplashScreen 琚彲闈犲仠姝€��
         try
@@ -19,5 +20,28 @@
         {
             // 濡傛灉 SplashScreen 宸茬粡涓嶅瓨鍦ㄦ垨宸茶绂佺敤锛屽拷鐣ュ紓甯�
         }
+#else
+        // Android 绛夊钩鍙帮細鍚屾璋冪敤 SplashScreen.Stop 鍦� BeforeSplashScreen 闃舵
+        // 浼氬鑷翠富绾跨▼姝婚攣锛圥layer Loop 灏氭湭瀹屽叏鍒濆鍖栵級锛屽繀椤婚�氳繃 Task.Run 寮傛鎵ц銆�
+        System.Threading.Tasks.Task.Run(() =>
+            SplashScreen.Stop(SplashScreen.StopBehavior.StopImmediate));
+#endif
     }
+
+#if !UNITY_IOS
+    // Android 绛夊钩鍙颁笂锛孊eforeSplashScreen 闃舵鐨� Task.Run 鍙兘鍥犳椂搴忕珵浜�
+    // 鑰岃寮曟搸蹇界暐锛孲ubsystemRegistration 闃舵寮曟搸瀛愮郴缁熷凡灏辩华锛屼綔涓轰繚搴曡皟鐢ㄧ‘淇� Stop 鐢熸晥銆�
+    [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
+    private static void CancelSplashScreenFallback()
+    {
+        try
+        {
+            SplashScreen.Stop(SplashScreen.StopBehavior.StopImmediate);
+        }
+        catch (System.Exception)
+        {
+            // 濡傛灉 SplashScreen 宸插湪涓婇潰鐨勫洖璋冧腑鍋滄锛岃繖閲岀殑 Stop 浼氭姏寮傚父锛屽拷鐣ュ嵆鍙�
+        }
+    }
+#endif
 }
\ No newline at end of file

--
Gitblit v1.8.0