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
1
Question by yellowpaper · Feb 13, 2013 at 03:19 PM · sceneruntimecreateat

Create scenes at runtime

EDIT: The question was based on an misunderstading of how scenes work. I will have to seralize runtime-changes by myself as it seems.

Hello,

the title explains it already. I want to create scenes at runtime and load them right after, though I haven't found the functionality for it. It seems Unity needs to know all its scenes when it gets built. The problem is that I want to make a map generator and one should be able to generate as much worlds as he likes. Creating scenes would come in handy for that purpose.

Otherwise it seems that I would have to serialize all my worlds and everytime the player changes the world, unserialize it and load it into a default empty scene, but frankly I don't like this idea.

Can anyone help?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by CoixdeNono · Feb 13, 2013 at 03:44 PM

Try to add the scenes to the build settings at runtime. I found this ( http://answers.unity3d.com/questions/10482/accessing-buildsettings-from-buildsettingsasset.html ) dont know if it helps : var original = EditorBuildSettings.scenes; var newSettings = new EditorBuildSettingsScene[original.Length + 1]; System.Array.Copy(original, newSettings, original.Length); var sceneToAdd = new EditorBuildSettingsScene("Assets/Path/To/Scene/sceneName.unity", false); newSettings[newSettings.Length - 1] = sceneToAdd; EditorBuildSettings.scenes = newSettings;

Comment
Add comment · Show 2 · 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 yellowpaper · Feb 13, 2013 at 03:54 PM 0
Share

Thank you for your answer, but this doesn't help me as EditorBuildSettings is an Editor class and respectively cannot be accessed at runtime.

avatar image CoixdeNono · Feb 13, 2013 at 03:55 PM 0
Share

Ah sorry then :)

avatar image
0

Answer by Yasantha · Feb 13, 2013 at 04:00 PM

what if you make Empty Scene with out anything. and load that scene after that load Ur prefabs trees as Assets dynamically. (Recourses.Load() )

Comment
Add comment · Show 2 · 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 CoixdeNono · Feb 13, 2013 at 04:04 PM 0
Share

Yes i can do that, thank for your help. But i'm trying to understant all the features of the AssetBundle. And i did, except for the download and import of a scene.

avatar image yellowpaper · Feb 13, 2013 at 04:27 PM 0
Share

Exactly that's what I want to do. But then I want to save that scene and create another, that is the actual problem. To have the possibility of theoretically infinite scenes, which I currently don't see in Unity.

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

11 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

Related Questions

How can I dynamically create scene ? 1 Answer

Display Raw Images at runtime in unity 4.6 0 Answers

Create a plane from points 1 Answer

How to create a Script from another Script on runtime 1 Answer

Can I create Scene via script? 2 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