Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by roy 1 · May 26, 2010 at 11:26 AM · buildplayer

BuildPipeline.BuildPlayer Question

Build streamed scene file into a seperate unity3d file,All script is missing,How to solve?I'm thinking that Unity is not building my scripts?

using UnityEngine; using UnityEditor; using System.Collections;

public class SimpleBuilder : EditorWindow {

 [MenuItem("Tools/SimpleBuilder")]
 private static void OpenBuilder() {
     new SimpleBuilder().Show();
 }

 void OnGUI() {
     if (GUILayout.Button("Build")) {
         string[] scenes = new string[] {"Assets/Islands.unity"};
         string filename = EditorUtility.SaveFilePanel("Save Player", "", "Unity Player (SimpleBuilder)", "app");
         BuildPipeline.BuildPlayer(scenes, filename, BuildTarget.WebPlayer, BuildOptions.BuildAdditionalStreamedScenes);
         Close();
     }
 }

}

Comment
Add comment · Show 1
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 Lucas Meijer 1 ♦♦ · May 27, 2010 at 07:31 AM 0
Share

Do you get a compile error? Do you have this script in a folder called "Editor"? does it also not work in an empty project?

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by equalsequals · May 26, 2010 at 03:04 PM

One thing I see is that you're passing in null to your BuildPipeline.BuildPlayer's first parameter. That should be an array of strings which are the asset paths to your scenes you want bundled. The second parameter is the full string path of the file you want to create. We make a separate folder called "Build" outside of our project's Assets folder and set it up that way but you can do whatever works for you.

To do one scene per bundle: (C#)

string[] _levels = new string[1]; _levels[0] = AssetDatabase.GetAssetPath("MySceneNameHere");

BuildPipeline.BuildPlayer(_levels, path + "MySceneNameHere" + ".unity3d", BuildTarget.WebPlayer, BuildOptions.BuildAdditionalStreamedScenes);

This is some slightly modified code from a tool I built to automate this sort of thing for my company's web games.I might have messed something up but if I didn't it should work.

Cheers,

==

Comment
Add comment · Show 4 · 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 roy 1 · May 26, 2010 at 04:23 PM 0
Share

Will compile the dependency scripts?

avatar image equalsequals · May 26, 2010 at 05:13 PM 0
Share

It should compile any script used in the scene, I believe.

avatar image roy 1 · May 27, 2010 at 01:07 AM 0
Share

I'm thinking that Unity is not building my scripts. here is the log file. If you see any thing thats wrong please help me out.

avatar image equalsequals · May 27, 2010 at 01:36 PM 0
Share

I can't see any log file, sorry.

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

No one has followed this question yet.

Related Questions

Unity5. How to build asset bundles and player with dependencies? 0 Answers

Build Player from Command Line 2 Answers

Unity standalone build removes PDB files from output folder 1 Answer

System.Collections error while building the player for windows phone 8 1 Answer

Can't use BuildFile.path. 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