Unity 3D Game Scene Conversion

Source: Internet
Author: User

2015/07/07////////

by xbw///////////////

Environment Unity 4.6.1//


When more than one scene is needed, a scene conversion is used,

Here, I have two scenes, one move (opening shot), another second (game scene);

If you want to run the game scene after opening a long shot, you need to use a function;;;

Application.loadlevel ("second"); quotes change is the scene that needs to be run, that is, the scene to be converted;

Of course this is the CSharp script;

Here, I used the GUI button to start the second scene,

At the end of the long shot, we need a button, like play, to get into the game;

Using unityengine;using System.collections;public class Cameramoveplay:monobehaviour {    void Start () {       }    void Updata () {    }    void Ongui ()    {        if (Guilayout.button ("PLAY"))            {                Application.loadlevel (" Second ");}}}    



Forget a problem, that is, two scenes also need to set up the add scene in the File->building setting, otherwise it will not achieve the successful switch.

The required scenes are added in order to succeed



Attach this piece of code to the main camera, and when we click on the play button, we will go to the next scene;

is not very easy ah, welcome students to communicate with each other to learn;



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

Unity 3D Game Scene Conversion

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.