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