using System; using System.Collections.Generic; using System.IO; using UnityEditor; using UnityEngine; public class SplashUtils { [MenuItem("SDK/SetSplashImage")] public static void SetSplashImage() { PlayerSettings.SplashScreen.show = true; PlayerSettings.SplashScreen.backgroundColor = Color.black; PlayerSettings.SplashScreenLogo[] logos = PlayerSettings.SplashScreen.logos; var logo = new PlayerSettings.SplashScreenLogo(); string splashAssetPath = AssetDatabase.GUIDToAssetPath(AssetDatabase.FindAssets("SplashImg")[0]); logo.duration = 2f; logo.logo = AssetDatabase.LoadAssetAtPath(splashAssetPath); if (logos == null) { logos = new PlayerSettings.SplashScreenLogo[] { logo }; } else { List logoList = new List(logos); logoList.Add(logo); logos = logoList.ToArray(); } PlayerSettings.SplashScreen.logos = logos; } }