Jump to content
  • Advertisement
NDraskovic

Automatically changing scenes in Unity build when changing the platform

Recommended Posts

Hey guys,

Like the title says, I'm trying to find out if it's possible to automatically set which scenes will be built for different platforms. For instance, I have scenes that I want to include when building for PC, but exclude them for mobile platforms. Is it possible to do this automatically (by some settings file, or by coding some editor extension), or do I have to manually (de)select them each time I switch platforms?

Google just keeps sending me to the documentation sites about the regular publishing, but I can't find information about this problem.

Thanks in advance

Edited by NDraskovic

Share this post


Link to post
Share on other sites
Advertisement

Second you use the Unity Commandline , to execute the build:
C:\program files\Unity\Editor\Unity.exe -quit -batchmode -executeMethod MyEditorScript.PerformBuild

I think if you include the reading of a JSON txt file in your "MyEditorScript" method you can further customize the code like:

"build.info":
 {"platform":"Windows","scenes":"Scene1|Scene2|Scene3"}
 {"platform":"Mac","scenes":"Scene4|Scene5|Scene6"}
 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!