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
相关推荐
龙智DevSecOps解决方案34 分钟前
Perforce《2025游戏技术现状报告》Part 1:游戏引擎技术的广泛影响以及生成式AI的成熟之路
人工智能·unity·游戏引擎·游戏开发·perforce
Y***K4349 小时前
C在游戏中的Godot
游戏·游戏引擎·godot
WarPigs20 小时前
Unity编辑器开发笔记
unity·编辑器·excel
Q***f63520 小时前
C++在游戏引擎开发中的实践
游戏引擎
6***x54520 小时前
C++在计算机视觉中的图像处理
c++·图像处理·计算机视觉·游戏引擎·logback·milvus
霜绛1 天前
Unity:lua热更新(三)——Lua语法(续)
unity·游戏引擎·lua
世洋Blog1 天前
更好的利用ChatGPT进行项目的开发
人工智能·unity·chatgpt
evolution_language2 天前
Unity场景(Scene)的注意事项和易错点
unity·游戏引擎·scene
EQ-雪梨蛋花汤2 天前
【AI工具】使用 Doubao-Seed-Code 优化 Unity 编辑器插件:从功能实现到界面美化的完整实践
人工智能·unity·编辑器
g***B7382 天前
元宇宙游戏引擎
游戏引擎