@needle-tools/engine 3.2.10-alpha → 3.2.11-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/dist/needle-engine.js +4 -4
- package/dist/needle-engine.min.js +2 -2
- package/dist/needle-engine.umd.cjs +2 -2
- package/lib/engine/engine_mainloop_utils.js +8 -6
- package/lib/engine/engine_mainloop_utils.js.map +1 -1
- package/lib/engine/extensions/NEEDLE_lighting_settings.js +2 -2
- package/lib/engine/extensions/NEEDLE_lighting_settings.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/engine/engine_mainloop_utils.ts +9 -6
- package/src/engine/extensions/NEEDLE_lighting_settings.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@needle-tools/engine",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.11-alpha",
|
|
4
4
|
"description": "Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in",
|
|
5
5
|
"main": "dist/needle-engine.umd.cjs",
|
|
6
6
|
"type": "module",
|
|
@@ -167,11 +167,14 @@ export function processStart(context: IContext, object?: Object3D) {
|
|
|
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 @@ function updateIsActiveInHierarchyRecursiveRuntime(go: Object3D, activeInHierarc
|
|
|
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 @@ export class NEEDLE_lighting_settings implements GLTFLoaderPlugin {
|
|
|
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 @@ export class SceneLightSettings extends Behaviour {
|
|
|
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) {
|