Nvisionxr_ios Tutorial 11-Multi-scene switching

Source: Internet
Author: User

This section teaches you how to switch back and forth in two scenarios.
Open the code for the previous section,
1, theMyfirstscenethe comment opens
2, theVideoscenethe boot state toGeneral_sceneplay,Code
 
Code:

Myfirstscene *firstscene = [[Myfirstscene alloc] initwithname:@ "First_scene"];     [[Nvappdirector Sharednvappdirector] addsceneplay:@ "Main_sceneplay" scene:firstscene];     Videoscene *videoscene = [[Videoscene alloc] initwithname:@ "Video_scene"]; [[Nvappdirector Sharednvappdirector] addsceneplay:@ "General_sceneplay" scene:videoscene];


3, soMyfirstsceneis set up as a startup scenario, andVideosceneset to wait for the scene.
OpenMYFIRSTSCENE.M, in tutorial Six has taught you how to do object interaction,
We switch scenes after clicking on the cube toVideoscene, if you have forgotten how to click the interaction, you can seeTutorial Six http://www.arvrschool.com/read-7392  

 
Code:

//  Click event  -  (void) OnClick: (nvwidget *) widget {      //  whether the clicked object is consistent with the object name of the cube      if  ([[widget  getname] isequaltostring:@ "Cube"])  {         //  Jump from one scene to another.          //  need to pass in parameters for the scene corresponding to the name           [self startsceneplayfrom:[self getname] to:@ "Video_scene"];      } } 


this will jump to the video scene when you click on the cube. ; Similarly, we can set a clickable object in the video scene, and when clicked to the object, jump to Myfirstscene scene, so that the scene can be switched to each other.

This article mainly introduces two scenes of the switch, you can also try to more than one scene between the switch.

Nvisionxr_ios Tutorial 11-Multi-scene switching

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.