From 952470d53334cea122c2ec74a0f204d8ddb6a035 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期二, 30 六月 2026 16:35:07 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_client

---
 Assets/Launch/SkipUnityLogo/Script/SkipUnityLogo.cs |   38 ++++++++++++++++++++++++++++++++++----
 1 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/Assets/Launch/SkipUnityLogo/Script/SkipUnityLogo.cs b/Assets/Launch/SkipUnityLogo/Script/SkipUnityLogo.cs
index 00fd9f6..8065332 100644
--- a/Assets/Launch/SkipUnityLogo/Script/SkipUnityLogo.cs
+++ b/Assets/Launch/SkipUnityLogo/Script/SkipUnityLogo.cs
@@ -1,6 +1,3 @@
-using System.Collections;
-using System.Collections.Generic;
-using System.Threading.Tasks;
 using UnityEngine;
 using UnityEngine.Rendering;
 using UnityEngine.Scripting;
@@ -12,6 +9,39 @@
     [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
     private static void CancelSplashScreen()
     {
-        Task.Run(()=>SplashScreen.Stop(SplashScreen.StopBehavior.StopImmediate));
+#if UNITY_IOS
+        // iOS 16+ 涓� Task.Run 鍦� BeforeSplashScreen 闃舵鍙兘鏃犳硶鍙婃椂璋冨害锛�
+        // 鏀圭敤鍚屾璋冪敤锛岀‘淇� SplashScreen 琚彲闈犲仠姝€��
+        try
+        {
+            SplashScreen.Stop(SplashScreen.StopBehavior.StopImmediate);
+        }
+        catch (System.Exception)
+        {
+            // 濡傛灉 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