| | |
| | | using System.Collections;
|
| | | using System.Collections.Generic;
|
| | | using System.Threading.Tasks;
|
| | | using UnityEngine;
|
| | | using UnityEngine.Rendering;
|
| | | using UnityEngine.Scripting;
|
| | |
| | | [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 已经不存在或已被禁用,忽略异常
|
| | | }
|
| | | }
|
| | | } |