using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
public class BuildUtil
{
[MenuItem("MyTools/AddMySplash")]
public static void SetSplashScreen()
{
PlayerSettings.SplashScreen.show = true;
var logo = new PlayerSettings.SplashScreenLogo();
//设置闪屏时间
logo.duration = 4f;
//设置闪屏背景颜色
PlayerSettings.SplashScreen.backgroundColor = Color.white;
//设置闪屏logo
logo.logo = AssetDatabase.LoadAssetAtPath<Sprite>("Assets/Texture/splash.png");
var sprite = AssetDatabase.LoadAssetAtPath<Sprite>("Assets/Texture/splash.png");
PlayerSettings.SplashScreen.logos = new PlayerSettings.SplashScreenLogo[1] { logo };
PlayerSettings.SplashScreen.background = sprite;
}
}```
网友评论