当前位置:   article > 正文

Unity Personal 去掉插屏预览_unity scripting.preserve

unity scripting.preserve

创建一个 SkipUnityLogo.cs类,内容如下:

  1. #if !UNITY_EDITOR
  2. using UnityEngine;
  3. using UnityEngine.Rendering;
  4. [UnityEngine.Scripting.Preserve]
  5. public class SkipUnityLogo
  6. {
  7. [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
  8. private static void BeforeSplashScreen()
  9. {
  10. #if UNITY_WEBGL
  11. Application.focusChanged += Application_focusChanged;
  12. #else
  13. System.Threading.Tasks.Task.Run(AsyncSkip);
  14. #endif
  15. }
  16. #if UNITY_WEBGL
  17. private static void Application_focusChanged(bool obj)
  18. {
  19. Application.focusChanged -= Application_focusChanged;
  20. SplashScreen.Stop(SplashScreen.StopBehavior.StopImmediate);
  21. }
  22. #else
  23. private static void AsyncSkip()
  24. {
  25. SplashScreen.Stop(SplashScreen.StopBehavior.StopImmediate);
  26. }
  27. #endif
  28. }
  29. #endif

即可去除

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/91919
推荐阅读
相关标签
  

闽ICP备14008679号