mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] Enable Skip Unity Logo
[+] Enable Skip Unity Logo
This commit is contained in:
34
Assets/TEngine/Runtime/Utility/BeforeSplashScreen.cs
Normal file
34
Assets/TEngine/Runtime/Utility/BeforeSplashScreen.cs
Normal 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
|
11
Assets/TEngine/Runtime/Utility/BeforeSplashScreen.cs.meta
Normal file
11
Assets/TEngine/Runtime/Utility/BeforeSplashScreen.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 31d5fedb24d4b5f40a58dbcf9ee66c70
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Reference in New Issue
Block a user