美文网首页
21、代码设置APP启动图片动画

21、代码设置APP启动图片动画

作者: GameObjectLgy | 来源:发表于2020-11-10 15:43 被阅读0次
    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;
        }
    }```
    
    

    相关文章

      网友评论

          本文标题:21、代码设置APP启动图片动画

          本文链接:https://www.haomeiwen.com/subject/bggjpktx.html