Unity APP
Xvisio SDK Documentation Home Page

Scenarios Jumping


1. Development of Scenarios Jumping

JumpScene1.unity JumpScene2.unity
Provide a scenarios jumping example based on annotation sdk.

2. Development Tutorial

Step 1:
As below, set the related components of SDK to "DontDestroyOnLoad".
image

Corresponding code:

public GameObject[] dontDestoryGroup;
    public GameObject uiRaycastCamera;//Note that this is a dynamically copied component

    void Start()
    {
        for (int i = 0; i < dontDestoryGroup.Length; i++)
        {
            DontDestroyOnLoad(dontDestoryGroup[i]);
        }

        uiRaycastCamera =  GameObject.Find("UIRaycastCamera");
        if (uiRaycastCamera != null)
        {
            DontDestroyOnLoad(uiRaycastCamera);
        }
    }

    //scenarios jumping code
    public void jumpScene()
    {
        SceneManager.LoadScene("JumpScene2");
    }

Step 2:
Add the needed two scenes to pack scenarios.
image

Step 3:
After packing the apk, user can jump the scenarios by clicking the button.


Unity APP
Xvisio SDK Documentation Home Page