forked from playcanvas/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathframework_pack.js
More file actions
51 lines (45 loc) · 2.12 KB
/
framework_pack.js
File metadata and controls
51 lines (45 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
pc.extend(pc.fw, function () {
var Pack = function (data) {
this.hierarchy = data.hierarchy;
this.settings = data.settings;
};
Pack.prototype = {
};
return {
Pack: Pack,
/**
* @function
* @name pc.fw.loadPack
* @description Load and initialise a new Pack. The Pack is loaded, added to the root of the hierarchy and any new scripts are initialized.
* @param {String} guid The GUID of the Pack to load
* @param {pc.fw.ApplicationContext} context The ApplicationContext containing the root hierarchy and the ScriptComponentSystem
* @param {Function} success Callback fired when the Pack is loaded and initialized, passed the new Entity that was created
* @param {Function} error Callback fired if there are problems, passed a list of error messages
* @param {Function} progress Callback fired on each progress event, usually when a file or Entity is loaded, passed a percentage complete value
*/
// loadPack: function (guid, context, success, error, progress) {
// var request = new pc.resources.PackRequest(guid);
// context.loader.request(request, function (resources) {
// var pack = resources[guid];
// // add to hierarchy
// context.root.addChild(pack.hierarchy);
// // Initialise any systems with an initialize() method after pack is loaded
// pc.fw.ComponentSystem.initialize(pack.hierarchy);
// // callback
// if (success) {
// success(pack);
// }
// }.bind(this), function (errors) {
// // error
// if (error) {
// error(errors);
// }
// }.bind(this), function (value) {
// // progress
// if (progress) {
// progress(value);
// }
// }.bind(this));
// }
};
}());