[Unity] unity如何用代码设置Splash Screen闪屏

查看:364 |回复:3 | 2021-2-23 18:17:45

您需要 登录 才可以下载或查看,没有账号?注册

x
本帖最后由 源数之力 于 2021-3-2 14:34 编辑

unity如何用代码设置Splash Screen闪屏
2021-2-23 18:17:45  
 赞 赞 0

使用道具 登录

3个回答,把该问题分享到群,邀请大神一起回答。
2#


  • using UnityEditor;







  • public class BuildUtil



  • {



  •     public static void SetSplashScreen()



  •     {



  •         PlayerSetttings.SplashScreen.show = true;



  •         var logo = new PlayerSetttings.SplashScreenLogo();



  •         //设置闪屏时间



  •         logo.duration = 4f;



  •         //设置闪屏背景颜色



  •         PlayerSetttings.SplashScreen.backgroundColor = Color.white;



  •         //设置闪屏logo



  •         logo.logo = AssetDatabase.LoadAssetAtPath<Sprite>("Assets/Texture/splash.png");







  •         PlayerSetttings.SplashScreen.logos = new PlayerSetttings.SplashScreenLogo[1] { logo };



  •     }



  • }





回复 收起回复
2021-2-23 18:30:02   回复
 赞 赞 1

使用道具 登录

4#
元素是个好家园,加油啊
回复 收起回复
2022-11-3 17:55:50   回复
 赞 赞 1

使用道具 登录

CG 游戏行业专业问题

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表