You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/framework/scene-registry.js
+18-6Lines changed: 18 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ import { SceneRegistryItem } from './scene-registry-item.js';
9
9
/**
10
10
* @class
11
11
* @name SceneRegistry
12
-
* @description Container for storing the name and url for scene files.
12
+
* @classdesc Container for storing and loading of scenes. An instance of the registry is created on the {@link Application} object as {@link Application#scenes}.
13
13
* @param {Application} app - The application.
14
14
*/
15
15
classSceneRegistry{
@@ -185,11 +185,19 @@ class SceneRegistry {
185
185
* @name SceneRegistry#loadSceneData
186
186
* @description Loads and stores the scene data to reduce the number of the network
187
187
* requests when the same scenes are loaded multiple times. Can also be used to load data before calling
188
-
* {@link SceneRegistry.loadSceneHierarchy} and {@link SceneRegistry#loadSceneSettings} to make
188
+
* {@link SceneRegistry#loadSceneHierarchy} and {@link SceneRegistry#loadSceneSettings} to make
189
189
* scene loading quicker for the user.
190
-
* @param {SceneRegistryItem | string} sceneItem - The scene item or URL of the scene file. Usually this will be "scene_id.json".
190
+
* @param {SceneRegistryItem | string} sceneItem - The scene item (which can be found with {@link SceneRegistry#find} or URL of the scene file. Usually this will be "scene_id.json".
191
191
* @param {callbacks.LoadSceneData} callback - The function to call after loading,
192
192
* passed (err, sceneItem) where err is null if no errors occurred.
193
+
* @example
194
+
*
195
+
* var sceneItem = app.scenes.find("Scene Name");
196
+
* app.scenes.loadSceneData(sceneItem, function (err, sceneItem) {
197
+
* if (err) {
198
+
* // error
199
+
* }
200
+
* });
193
201
*/
194
202
loadSceneData(sceneItem,callback){
195
203
this._loadSceneData(sceneItem,true,callback);
@@ -199,7 +207,11 @@ class SceneRegistry {
199
207
* @function
200
208
* @name SceneRegistry#unloadSceneData
201
209
* @description Unloads scene data that has been loaded previously using {@link SceneRegistry#loadSceneData}.
202
-
* @param {SceneRegistryItem | string} sceneItem - The scene item or URL of the scene file. Usually this will be "scene_id.json".
210
+
* @param {SceneRegistryItem | string} sceneItem - The scene item (which can be found with {@link SceneRegistry#find} or URL of the scene file. Usually this will be "scene_id.json".
211
+
* @example
212
+
*
213
+
* var sceneItem = app.scenes.find("Scene Name");
214
+
* app.scenes.unloadSceneData(sceneItem);
203
215
*/
204
216
unloadSceneData(sceneItem){
205
217
if(typeofsceneItem==='string'){
@@ -216,7 +228,7 @@ class SceneRegistry {
216
228
* @name SceneRegistry#loadSceneHierarchy
217
229
* @description Load a scene file, create and initialize the Entity hierarchy
218
230
* and add the hierarchy to the application root Entity.
219
-
* @param {SceneRegistryItem | string} sceneItem - The scene item or URL of the scene file. Usually this will be "scene_id.json".
231
+
* @param {SceneRegistryItem | string} sceneItem - The scene item (which can be found with {@link SceneRegistry#find} or URL of the scene file. Usually this will be "scene_id.json".
220
232
* @param {callbacks.LoadHierarchy} callback - The function to call after loading,
221
233
* passed (err, entity) where err is null if no errors occurred.
222
234
* @example
@@ -275,7 +287,7 @@ class SceneRegistry {
275
287
* @function
276
288
* @name SceneRegistry#loadSceneSettings
277
289
* @description Load a scene file and apply the scene settings to the current scene.
278
-
* @param {SceneRegistryItem | string} sceneItem - The scene item or URL of the scene file. Usually this will be "scene_id.json".
290
+
* @param {SceneRegistryItem | string} sceneItem - The scene item (which can be found with {@link SceneRegistry#find} or URL of the scene file. Usually this will be "scene_id.json".
279
291
* @param {callbacks.LoadSettings} callback - The function called after the settings
280
292
* are applied. Passed (err) where err is null if no error occurred.
0 commit comments