Unity 去Unity Log 去Splash图 非正式版也可以

Unity 去Unity Log 去Splash图 非正式版也可以

  • [将脚本丢到Asset目录下 打包出来即可](#将脚本丢到Asset目录下 打包出来即可)
  • 代码

将脚本丢到Asset目录下 打包出来即可

代码

csharp 复制代码
#if !UNITY_EDITOR
using UnityEngine;
using UnityEngine.Rendering;
using 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
相关推荐
Liam_Lsc9 小时前
Unity 实现伤害跳字
unity·游戏引擎
努力的小钟17 小时前
虚幻引擎UActorComponent的TickComponent详解
游戏引擎·虚幻
虾球xz1 天前
游戏引擎学习第210天
学习·游戏引擎
维度攻城狮2 天前
高效创建工作流,可实现类似unreal engine的蓝图效果,内部使用多线程高效执行节点函数
python·游戏引擎·开源软件·虚幻·graph·工作流
浅陌sss2 天前
设计模式 --- 原型模式
unity·游戏引擎
2 天前
Unity中基于2.5D的碰撞系统
unity·游戏引擎
scott.cgi2 天前
「Unity3D」TextMeshPro中的TMP_InputField,用来实现输入框的几个小问题
unity·ugui·textmeshpro·tmp_inputfield·inputfield·inputfield输入框·ugui输入框
虾球xz2 天前
游戏引擎学习第212天
c++·学习·游戏引擎
虾球xz2 天前
游戏引擎学习第209天
学习·游戏引擎
蔗理苦2 天前
2025-04-08 NO.4 Quest3 交互教程
unity·交互·vr·quest