forked from playcanvas/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscriptB.js
More file actions
31 lines (26 loc) · 1.06 KB
/
Copy pathscriptB.js
File metadata and controls
31 lines (26 loc) · 1.06 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
var ScriptB = pc.createScript('scriptB');
ScriptB.prototype.initialize = function() {
var guid = this.entity.getGuid();
window.initializeCalls.push(guid + ' initialize scriptB');
this.entity.script.on('enable', function () {
window.initializeCalls.push(guid + ' enable scriptB');
});
this.entity.script.on('disable', function () {
window.initializeCalls.push(guid + ' disable scriptB');
});
this.entity.script.on('state', function (enabled) {
window.initializeCalls.push(guid + ' state ' + enabled + ' scriptB');
});
this.on('destroy', function () {
window.initializeCalls.push(this.entity.getGuid() + ' destroy scriptB');
});
};
ScriptB.prototype.postInitialize = function() {
window.initializeCalls.push(this.entity.getGuid() + ' postInitialize scriptB');
};
ScriptB.prototype.update = function () {
window.initializeCalls.push(this.entity.getGuid() + ' update scriptB');
};
ScriptB.prototype.postUpdate = function () {
window.initializeCalls.push(this.entity.getGuid() + ' postUpdate scriptB');
};