@@ -167,11 +167,14 @@
|
|
167
167
|
// keep them in queue until script has started
|
168
168
|
// call awake if the script was inactive before
|
169
169
|
utils.safeInvoke(script.__internalAwake.bind(script));
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
170
|
+
if(script.enabled)
|
171
|
+
{
|
172
|
+
utils.safeInvoke(script.__internalEnable.bind(script));
|
173
|
+
// now call start
|
174
|
+
utils.safeInvoke(script.__internalStart.bind(script));
|
175
|
+
context.new_script_start.splice(i, 1);
|
176
|
+
i--;
|
177
|
+
}
|
175
178
|
}
|
176
179
|
catch (err) {
|
177
180
|
console.error(err);
|
@@ -274,7 +277,7 @@
|
|
274
277
|
}
|
275
278
|
}
|
276
279
|
else {
|
277
|
-
if (comp["__didAwake"]) {
|
280
|
+
if (comp["__didAwake"] && comp.enabled) {
|
278
281
|
comp["__didEnable"] = false;
|
279
282
|
comp.onDisable();
|
280
283
|
}
|
@@ -75,7 +75,7 @@
|
|
75
75
|
ContextRegistry.registerCallback(ContextEvent.ContextCreated, e => {
|
76
76
|
const ctx = e.context as Context;
|
77
77
|
const lightingSettings = GameObject.findObjectOfType(SceneLightSettings, ctx as Context);
|
78
|
-
if (lightingSettings?.sourceId)
|
78
|
+
if (lightingSettings?.sourceId) lightingSettings.enabled = true;
|
79
79
|
})
|
80
80
|
|
81
81
|
// exists once per gltf scene root (if it contains reflection)
|
@@ -130,7 +130,7 @@
|
|
130
130
|
}
|
131
131
|
|
132
132
|
onEnable(): void {
|
133
|
-
if (debug) console.warn("💡🟡 >>> Enable lighting", this.sourceId, this);
|
133
|
+
if (debug) console.warn("💡🟡 >>> Enable lighting", this.sourceId, this.enabled, this);
|
134
134
|
|
135
135
|
if (this.ambientMode == AmbientMode.Flat) {
|
136
136
|
if (this.ambientLight && !this._ambientLightObj) {
|