-
-
Notifications
You must be signed in to change notification settings - Fork 49
refactor: remove StaticScripts
resource
#473
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
Conversation
Changed Files
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the scripting system by removing the StaticScripts
resource and changing how static scripts are identified - they are now detected by the absence of a corresponding ScriptComponent
on any entity.
- Removes the
StaticScripts
resource and all associated methods - Updates static script identification logic to use entity component absence detection
- Simplifies script handling by eliminating the dual attachment system
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
tests/script_tests.rs | Simplifies error handling in test executor |
examples/game_of_life.rs | Replaces StaticScripts resource with local vector for tracking |
crates/languages/bevy_mod_scripting_lua/src/lib.rs | Adds world configuration setup for test consistency |
crates/bevy_mod_scripting_core/src/script/mod.rs | Removes StaticScripts struct and all related functionality |
crates/bevy_mod_scripting_core/src/lib.rs | Updates plugin configuration and removes resource initialization |
crates/bevy_mod_scripting_core/src/extractors.rs | Removes static scripts handling from handler context |
crates/bevy_mod_scripting_core/src/config.rs | Renames configuration method for clarity |
crates/bevy_mod_scripting_core/src/commands.rs | Removes static script management from commands |
crates/bevy_mod_scripting_core/src/asset.rs | Updates script event handling to use entity-based detection |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Summary
Static scripts are now identified by the abscence of a
ScriptComponent
corresponding to the asset on any entity.Migration Guide
references to
StaticScripts
should be replaced with appropriate resident calls onScriptContext
filtered by the attachment kind