Skip to main content

Scene Manager

Scene management for Genies Experiences needs to use Genies API and also make sure the scenes are added to the build settings.

Unity Default Scene Manager

Unity's default Scene Manager API does not work when developing Genies Experiences.

info

Read the Dev Kit Features and Limitations for more information on what is not allowed when developing Genies Experiences.

Build Settings

In order for scenes to be loaded in the Unity developer, make sure that all scenes are added to the build settings. Open the Build Settings window by clicking the top menu File > Build Settings. From the Project window, drag and drop all scenes that will be loaded. Make sure they are checkmarked.

Build Settings

note

When building the Experience, the checkmarks will be deactivated so make sure to recheck them after building.

TypeScript Usage

danger

The Scene Manager API is currently not available in the Dev Kit.

Package

To use the Scene Manager API, it is required to import the library like so:

import { SceneManager } from "GeniesSDK.SceneManagement"

Example

Here is an example script for loading a new scene when a button is pressed:

import { SceneManager } from "GeniesSDK.SceneManagement"
import { MonoBehaviour } from "UnityEngine";
import { Button } from "UnityEngine.UI";

export default class MyScript extends MonoBehaviour {

public playButton : Button;

Start() {
this.playButton.onClick.AddListener(
() => SceneManager.LoadScene("Level 1")
);
}
}