-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtimebehavior.js
79 lines (79 loc) · 1.87 KB
/
runtimebehavior.js
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
var gdjs;
(function(gdjs2) {
class RuntimeBehavior {
constructor(runtimeScene, behaviorData, owner) {
this.owner = owner;
this._activated = true;
this.name = behaviorData.name || "";
this.type = behaviorData.type || "";
this._nameId = gdjs2.RuntimeObject.getNameIdentifier(this.name);
}
updateFromBehaviorData(oldBehaviorData, newBehaviorData) {
return false;
}
getName() {
return this.name;
}
getNameId() {
return this._nameId;
}
stepPreEvents(runtimeScene) {
if (this._activated) {
const profiler = runtimeScene.getProfiler();
if (profiler) {
profiler.begin(this.name);
}
this.doStepPreEvents(runtimeScene);
if (profiler) {
profiler.end(this.name);
}
}
}
stepPostEvents(runtimeScene) {
if (this._activated) {
const profiler = runtimeScene.getProfiler();
if (profiler) {
profiler.begin(this.name);
}
this.doStepPostEvents(runtimeScene);
if (profiler) {
profiler.end(this.name);
}
}
}
activate(enable) {
if (enable === void 0) {
enable = true;
}
if (!this._activated && enable) {
this._activated = true;
this.onActivate();
} else {
if (this._activated && !enable) {
this._activated = false;
this.onDeActivate();
}
}
}
onCreated() {
}
activated() {
return this._activated;
}
onActivate() {
}
onDeActivate() {
}
doStepPreEvents(runtimeScene) {
}
doStepPostEvents(runtimeScene) {
}
onDestroy() {
}
onObjectHotReloaded() {
}
}
gdjs2.RuntimeBehavior = RuntimeBehavior;
gdjs2.registerBehavior("", gdjs2.RuntimeBehavior);
})(gdjs || (gdjs = {}));
//# sourceMappingURL=runtimebehavior.js.map