Unity multiple scene overlay or large scene processing method summary

Source: Internet
Author: User

This article is written by Cartzhang, reproduced please indicate the source. All rights reserved.
Article Link: http://blog.csdn.net/cartzhang/article/details/47614153
Cartzhang


I want to write a summary, but just contact!


For objects in unity, multiple scenes or large scene multi-person split processing, there is no way to modify the scene at the same time to submit.

What about this?


method One, establish prefab

Create an Prefab object for an object or object that needs to be used under multiple scenes, so that it can be used in multiple scenarios.


Method Two, there is an expert own way

is to write a scene management and scene loading XML and JSON Ah, ah!!

Website: http://www.gopedu.com/article/1424, shortcut: Unity3d merging and restoring of project cooperation scenarios

I think this is already very powerful!


Method Three,

Unity has a pack of features that are pretty powerful. You can divide and play the map, each to do their own things, and then put in a unified scene Ah!

How do you put it?

First, you need to add the scene to the build setting, such as:

Then, you need the code:

This is super simple: the name is AddNewScene.cs

Using unityengine;using System.collections;public class Addnewscene:monobehaviour {public    string levelname;     Use the This for Initializationvoid Start ()     {        if (levelname.length > 0)        {            Application.loadleveladditive (levelname);            Debug.Log ("Level  add successfully!");        }        else        {            Debug.Log ("level was not  added!");        }}}

Then hang the code on the camera or other object.

For example, I hung it on the camera:


Run try: see that round pillar no, it is.



Finally, foreign buddies one way

You may not be able to open the webpage: http://luminesca.blogspot.com/2013/05/sublevels.html

This means that when you feel that prefab is not satisfying your needs, you can separate your scene objects by their type.

The key is a picture:



Simple description: Is to put the scene of the public resources or objects in a level, to belong to a unique object placed in a certain level!!

In this case, it is a classification. Then use the application.loadleveladditive above .

This is a kind of subdivision.


------------------

If you have any questions, please feel free to contact us!


Thank you so much!






Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Unity multiple scene overlay or large scene processing method summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.