unity用代码设置Splash Screen闪屏

  1. using UnityEditor;
  2. public class BuildUtil
  3. {
  4. public static void SetSplashScreen()
  5. {
  6. PlayerSetttings.SplashScreen.show = true;
  7. var logo = new PlayerSetttings.SplashScreenLogo();
  8. //设置闪屏时间
  9. logo.duration = 4f;
  10. //设置闪屏背景颜色
  11. PlayerSetttings.SplashScreen.backgroundColor = Color.white;
  12. //设置闪屏logo
  13. logo.logo = AssetDatabase.LoadAssetAtPath<Sprite>("Assets/Texture/splash.png");
  14. PlayerSetttings.SplashScreen.logos = new PlayerSetttings.SplashScreenLogo[1] { logo };
  15. }
  16. }
(0)

相关推荐