-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabled parameter not included in awaiting component when create script #7361
Comments
Hey @YuniChou thanks for flagging this. Do you have a repro of this error? |
Hi @marklundin , here is my repo that can reproduce. I'm making a project which whould like to load diffrient editor scenes using engine-only way. A: B: Following the other proper route indeed avoids the component awaiting situation, |
Thanks for the repro @YuniChou 🙏 I'm not 100% clear on the issue. I can see you have an empty I have stripped out that part so it just loads the config, and you can see that it correctly does not initialize |
Sorry for making you misunderstand! Let me use another example to clarify. Without overriding anything, I set hidden.js The Box entity's hidden script enabled is set to const asset = app.assets.find('hidden.js');
app.assets.load(asset); Or is this something I shouldn't do? 🙏 config.json {
"215181886": {
"name": "hidden.js",
"preload": false,
}
} 2175667.json {
"e951e842-82e0-11ee-9eae-baf4d5e490e2": {
"name": "Root",
"components": {
"script": {
"enabled": true,
"order": ["hidden", "hello"],
"scripts": {
"hidden": { "enabled": false, "attributes": {} },
"hello": { "enabled": true, "attributes": {} }
}
}
},
},
"e952058e-82e0-11ee-9eae-baf4d5e490e2": {
"name": "Box",
"script": {
"enabled": true,
"order": ["hidden"],
"scripts": { "hidden": { "enabled": true, "attributes": {} } }
}
},
} |
In sync or async loading scenarios,
So if this behaves differently, then it is bug indeed. |
Hi all, I'm having trouble synchronizing the enabled attribute of a script.
I will import the script files after calling
app.scene.loadScene
and it will miss theinitializeComponentData
function (script/system.js
).The script should bind automatically on entity when
registerScript
runs, as it checks is there any components awaiting for script. (script-registry.js:134
).However, I found that the enabled value from
_scriptsData
is missing in the create function’s parameters.Would it be reasonable to add it back like the example below?
Waiting for your feedback and suggestions. Thank you!
The text was updated successfully, but these errors were encountered: