三国卡牌客户端基础资源仓库
hch
2026-06-28 77dd69e22378ded534f17ef98a397dd791cb4bd1
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,15 @@
    [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
    private static void CancelSplashScreen()
    {
        Task.Run(()=>SplashScreen.Stop(SplashScreen.StopBehavior.StopImmediate));
        // iOS 16+ 上 Task.Run 在 BeforeSplashScreen 阶段可能无法及时调度,
        // 改用同步调用,确保 SplashScreen 被可靠停止。
        try
        {
            SplashScreen.Stop(SplashScreen.StopBehavior.StopImmediate);
        }
        catch (System.Exception)
        {
            // 如果 SplashScreen 已经不存在或已被禁用,忽略异常
        }
    }
}