[+] Enable Skip Unity Logo

[+] Enable Skip Unity Logo
This commit is contained in:
ALEXTANG
2023-05-12 23:41:59 +08:00
parent de0d4e58a5
commit 4db89019dd
2 changed files with 45 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
#if UNITY_EDITOR && SKIP_UNITYLOGO
using UnityEngine;
using UnityEngine.Rendering;
/// <summary>
/// 跳过UnityLogo
/// </summary>
[UnityEngine.Scripting.Preserve]
public class SkipUnityLogo
{
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
private static void BeforeSplashScreen()
{
#if UNITY_WEBGL
Application.focusChanged += Application_focusChanged;
#else
System.Threading.Tasks.Task.Run(AsyncSkip);
#endif
}
#if UNITY_WEBGL
private static void Application_focusChanged(bool obj)
{
Application.focusChanged -= Application_focusChanged;
SplashScreen.Stop(SplashScreen.StopBehavior.StopImmediate);
}
#else
private static void AsyncSkip()
{
SplashScreen.Stop(SplashScreen.StopBehavior.StopImmediate);
}
#endif
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 31d5fedb24d4b5f40a58dbcf9ee66c70
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: