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
[DOCS] Updated tests and docs for sceneRegistry loadScene* functions (playcanvas#2009)
* Removed app.loadScene* callbacks from docs
* Updated code sample in documentation getSceneUrl
* Removed loadScene from public API
* Added callbacks for the SceneRegistry load* functions
* Updated tests to use SceneRegistry instead of deprecated app function
* Update test to use pc.SceneRegistry
* Load Scene is public again, removed unused callbacks
* Removed callbacks.loadScene from private API
* Better param docs for callbacks.
* Remove new line
* Fix callback types
Co-authored-by: Steven Yau <syau@snaphcat.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Copy file name to clipboardExpand all lines: src/framework/scene-registry.js
+12-7Lines changed: 12 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -129,11 +129,12 @@ Object.assign(pc, function () {
129
129
* @description Load a scene file, create and initialize the Entity hierarchy
130
130
* and add the hierarchy to the application root Entity.
131
131
* @param {string} url - The URL of the scene file. Usually this will be "scene_id.json".
132
-
* @param {Function} callback - The function to call after loading, passed (err, entity) where err is null if no errors occurred.
132
+
* @param {pc.callbacks.LoadHierarchy} callback - The function to call after loading,
133
+
* passed (err, entity) where err is null if no errors occurred.
133
134
* @example
134
135
*
135
-
* var url = app.getSceneUrl("Scene Name");
136
-
* app.loadSceneHierarchy(url, function (err, entity) {
136
+
* var url = app.scenes.getSceneUrl("Scene Name");
137
+
* app.scenes.loadSceneHierarchy(url, function (err, entity) {
137
138
* if (!err) {
138
139
* var e = app.root.find("My New Entity");
139
140
* } else {
@@ -188,7 +189,8 @@ Object.assign(pc, function () {
188
189
* @name pc.SceneRegistry#loadSceneSettings
189
190
* @description Load a scene file and apply the scene settings to the current scene.
190
191
* @param {string} url - The URL of the scene file. This can be looked up using app.getSceneUrl.
191
-
* @param {Function} callback - The function called after the settings are applied. Passed (err) where err is null if no error occurred.
192
+
* @param {pc.callbacks.LoadSettings} callback - The function called after the settings
193
+
* are applied. Passed (err) where err is null if no error occurred.
192
194
* @example
193
195
*
194
196
* var url = app.getSceneUrl("Scene Name");
@@ -226,9 +228,12 @@ Object.assign(pc, function () {
226
228
/**
227
229
* @function
228
230
* @name pc.SceneRegistry#loadScene
229
-
* @description Load the scene hierarchy and scene settings. This is an internal method used by the pc.Application.
230
-
* @param {string} url - The URL of the scene file.
231
-
* @param {Function} callback - The function called after the settings are applied. Passed (err, scene) where err is null if no error occurred and scene is the pc.Scene.
231
+
* @description Load the scene hierarchy and scene settings. This is an internal method used
232
+
* by the pc.Application.
233
+
* @param {string} url - The URL of the scene file.
234
+
* @param {pc.callbacks.LoadScene} callback - The function called after the settings are
235
+
* applied. Passed (err, scene) where err is null if no error occurred and scene is the
0 commit comments