Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
1
Question by JorgeGameDev · Apr 27, 2018 at 03:34 AM · editorsplash-screenbuildpipeline

BuildPipeline.BuildPlayer() missing splash screen tools background.

I am currently working on a build pipeline to use during project development, and have been reading and utilizing the BuildPipeline UnityEditor class, together with related structs (such as BuildPlayerOptions) to attempt and develop an editor menu option that builds all of our platforms in a single click, instead of having to manually wait for each compile to change the platform to build each individual player.

 

Since most of the code I’ve built so far is designed on top of the example in the Scripting API, the task has been mostly successful, with all the players building as expected.

 

As our team uses Unity Personal, we utilize Unity's built-in splash screen tools in order to design our splash screens. However, when creating the players using the BuildPipeline.BuildPlayer() function, the player will ship with the splash screen’s background missing from all of the builds. This behaviour doesn't happen when manually building a player with the 'Build Settings' or using 'Build & Run' where the splash screen background shows as intended.

 

I have not been able to find the reason as to why this happens, and have even tried to manually feed the splash screen Sprite to the PlayerSettings.SplashScreen.background by code but without any diference in results.

 

To give a better understanding of the situation, I have attached example screenshots of what's currently happening, as well as the code being used, bellow.

 

Splash Screen Missing using 'BuildPipeline.BuildPlayer()': alt text

 

Splash Screen displaying on a build manually created from 'Build Settings': alt text

 

Splash Screen options in the Player Settings: alt text

 

Code being used:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEditor;
 using System.IO;
 
 public class BuildTools : MonoBehaviour
 {
     /// <summary>
     /// Queues up all the build players to be built.
     /// </summary>
     [MenuItem("Build/Build All Players")]
     public static void BuildAllPlayers()
     {
         BuildPlatform(BuildTarget.StandaloneWindows, "-windows-32");
         BuildPlatform(BuildTarget.StandaloneWindows64, "-windows-64");
         BuildPlatform(BuildTarget.StandaloneOSX, "-mac-osx");
         BuildPlatform(BuildTarget.StandaloneLinuxUniversal, "-linux");
     }
 
     /// <summary>
     /// Builds the target to this platform.
     /// </summary>
     public static void BuildPlatform(BuildTarget target, string platformId)
     {
         // Sets up the directory where the build will be placed at. Stored for extra uses.
         string buildDirectory = Application.dataPath;
         buildDirectory = buildDirectory.Substring(0, buildDirectory.Length - 6); // Removes 'Assets/' from the path, so builds are placed on the project folder instead.
         buildDirectory += "Builds" + Path.DirectorySeparatorChar; // Appends the Build folder.
         buildDirectory += Application.productName.ToLower() + platformId + Path.DirectorySeparatorChar; // Appends the platform folder.
 
         // Sets up the remainder of the build directory.
         string buildPath = buildDirectory + Application.productName + Path.DirectorySeparatorChar; // Appends the game directory.
         buildPath += Application.productName + ".exe"; // Apends the actual .exe path.
 
         // Sets up player options.
         BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions
         {
             target = target,
             scenes = GetScenes(),
             locationPathName = buildPath,
             options = BuildOptions.None,
         };

         // Outputs the build, checking for each errors.
         string error = BuildPipeline.BuildPlayer(buildPlayerOptions);
         if (error == "")
             Debug.LogWarning("Sucessfully Built " + platformId + " at " + buildDirectory + ".");
         else
             Debug.LogError("Error Building " + platformId + ".");
     }
 
     /// <summary>
     /// Gets the scenes from the build settings to be appended to the build options.
     /// </summary>
     public static string[] GetScenes()
     {
         string[] scenes = new string[EditorBuildSettings.scenes.Length];
         for (int i = 0; i < scenes.Length; i++)
         {
             scenes[i] = EditorBuildSettings.scenes[i].path;
         }
         return scenes;
     }
 }

 

Anyone has any idea of what could possibly be creating this behaviour or if there is any other code I should add that can possibly solve the issue?

 

Thanks!

2018-04-27-15h-06m-02s.png (131.7 kB)
2018-04-27-15h-09m-19s.png (356.8 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Extrawurst · Jan 17, 2019 at 11:54 AM

Hi,

I was facing the same issue still with 2018.3. Turns out the -nographics as an option on the command line was causing the issue. getting rid of this parameter fixed the issue.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image karl_jones ♦♦ · Jan 17, 2019 at 02:22 PM 0
Share

Yes we currently use the GPU to generate the blur effect on the splash screen which means -nographics will not work with the splash screen. I have made some changes so that we now use the CPU which I hope to have in 2019.2.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

166 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Editor Splash Screen freezing 0 Answers

can I exclude editor script when build scene assetsbundle? 0 Answers

Hierarchy disappears in Unity 5.2 from 4.6.8 1 Answer

How to save a two-dimensional array, as part of the variable inspector? 0 Answers

Change 3rd person controller jump 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges