SkipUnityLogo.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #if !UNITY_EDITOR
  2. using UnityEngine;
  3. using UnityEngine.Rendering;
  4. public class SkipUnityLogo
  5. {
  6. [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSplashScreen)]
  7. private static void BeforeSplashScreen()
  8. {
  9. #if UNITY_WEBGL
  10. Application.focusChanged += Application_focusChanged;
  11. #else
  12. System.Threading.Tasks.Task.Run(AsyncSkip);
  13. #endif
  14. }
  15. #if UNITY_WEBGL
  16. private static void Application_focusChanged(bool obj)
  17. {
  18. Application.focusChanged -= Application_focusChanged;
  19. SplashScreen.Stop(SplashScreen.StopBehavior.StopImmediate);
  20. }
  21. #else
  22. private static void AsyncSkip()
  23. {
  24. SplashScreen.Stop(SplashScreen.StopBehavior.StopImmediate);
  25. }
  26. #endif
  27. }
  28. #endif
  29. // 百度和谷歌了一下解决方法,最终是通过用国外ip来重新激活license(仍然选择个人免费版),就解决问题了。
  30. // 就是说只要不是国内ip去激活,就不会显示 trial version 字样了。
  31. // 删除它的project settings文件夹。删除这个文件夹会导致一些配置的丢失,所以如果这样做的话需要考虑把配置迁移过来。