Scene Assets

In Cocos Creator, the Scene is the cornerstone for organizing game content during development, and presenting all game content to the players. The Scene itself is a file, also considered a game asset, and saves most of the game's information.

Creating a Scene

There are three ways to create a Scene:

  1. Select the folder where you want to create the Scene file in the Assets. On the folder Right click --> New --> Scene file, and then type the desired Scene name.

    new_scene_1

    In order to have a good directory structure in your project, it is strongly recommend that you use this method to create a Scene.

  2. Click the Create menu in the Assets to create a new Scene.

    new_scene_2

  3. Select File -> New Scene, a new Scene will appear directly in the Hierarchy panel, but a new Scene will not appear in the Assets. You need to save it in the root of the asset folder. A New Scene.scene Scene file appears in the directory.

    new_scene_3

Saving a Scene

While creating Scenes, you can quickly save Scenes with the shortcut keys Ctrl + S (Windows) or Command + S (Mac).

Switching Scenes

In the Assets, double-click the Scene you want to open. When needing to switch Scenes in the game, use the director.loadScene() API to implement dynamic scene loading and switching in the game. For further details, please see the API documentation.

Scene Asset Properties

Since the Scene is an Asset a property can be set in the Assets to load assets asynchronously.

scene set

After opening the Scene file, Scene is the root node of the Scene node tree. Select the Scene node in the Hierarchy panel. In the Inspector panel on the left, you can set the properties of the entire Scene, including ambient light settings, shadow settings and sky box settings.

scene_node_set

For a detailed description of each property, see the following documents:

results matching ""

    No results matching ""