-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Store Resources as components on singleton entities #20934
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
Open
Trashtalk217
wants to merge
71
commits into
bevyengine:main
Choose a base branch
from
Trashtalk217:resource-as-components
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+761
−669
Open
Changes from all commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
042337f
add back all changes
Trashtalk217 47c20a5
Merge branch 'main' of https://github.com/bevyengine/bevy into resour…
Trashtalk217 64eac9a
cargo fmt
Trashtalk217 956c1a6
cargo clippy
Trashtalk217 073df4b
add entities with resources, auto disabled IsResource
Trashtalk217 6c8281d
fixed and tests
Trashtalk217 f9dc9f1
fixed more tests
Trashtalk217 07723ac
fixed moore tests
Trashtalk217 1ba7af2
fix ci
Trashtalk217 b89c042
fix mooore tests (benches)
Trashtalk217 9b33933
fix docs
Trashtalk217 c7b4f1d
add migration guide
Trashtalk217 96aef45
fixed spelling errors to prove I'm not AI
Trashtalk217 e3ccd1b
Merge branch 'main' of https://github.com/bevyengine/bevy into resour…
Trashtalk217 5758134
addressed comments
Trashtalk217 9824c3a
testing robustness
Trashtalk217 9acf43f
Merge branch 'main' of https://github.com/bevyengine/bevy into resour…
Trashtalk217 da1d203
merge upstream
Trashtalk217 4d4e914
cleanup
Trashtalk217 78a0672
fix more stuff
Trashtalk217 4a2416d
update migration guides
Trashtalk217 3942c56
spelling
Trashtalk217 511e0b9
update resource macros to implement Component
Trashtalk217 d4c98eb
fix tests
Trashtalk217 724a4c4
merge
Trashtalk217 f442ff6
fix imports
Trashtalk217 acb539e
second attempt at fixing a test
Trashtalk217 a0d76c3
merge
Trashtalk217 c99df9c
Merge branch 'resource_entity_lookup' of github.com:trashtalk217/bevy…
Trashtalk217 12383a3
Merge branch 'main' of https://github.com/bevyengine/bevy into resour…
Trashtalk217 34570e8
Merge branch 'resource_entity_lookup' into resource-as-components
Trashtalk217 f43905d
removed send resources from Storages
Trashtalk217 36e8191
fixed more tests
Trashtalk217 d1b9b56
Merge branch 'main' of https://github.com/bevyengine/bevy into resour…
Trashtalk217 bfb2829
Merge branch 'resource_entity_lookup' into resource-as-components
Trashtalk217 011b068
cleanup
Trashtalk217 a12ec78
partly fixed bevy_scene
Trashtalk217 2261f8b
Merge branch 'main' of https://github.com/bevyengine/bevy into resour…
Trashtalk217 7f224be
address comments
Trashtalk217 4b0c77b
Merge branch 'resource_entity_lookup' into resource-as-components
Trashtalk217 6fdf25e
fixed try_resource_scope in part
Trashtalk217 2b1a5b5
fixed require() statement for AmbientLight
Trashtalk217 e8c67cc
change location of resource_entities
Trashtalk217 a01dc7d
changed scene serialization
Trashtalk217 9aecdf3
removed ResourceEntity, redid bevy_scene, require ReflectComponent for
Trashtalk217 3ddf8bf
fixed final tests
Trashtalk217 f0e973a
cargo clippy fixes
Trashtalk217 02c2b5f
Merge branch 'main' of https://github.com/bevyengine/bevy into resour…
Trashtalk217 8c1c818
removed dead code
Trashtalk217 1383efd
typo
Trashtalk217 2f9990a
more clippy
Trashtalk217 678da53
fixed get_resources_mut and unsoundness Res and ResMut
Trashtalk217 67810f4
updated docs
Trashtalk217 af03cec
improve docs and name
Trashtalk217 25b49d0
cargo clippy
Trashtalk217 1117cfa
typos
Trashtalk217 e3b12c2
fixed bevy_render bug
Trashtalk217 33bd43d
fixed bevy_remove
Trashtalk217 18c7664
Merge branch 'main' of https://github.com/bevyengine/bevy into resour…
Trashtalk217 c75da2c
added ReflectComponent to debug_overlay
Trashtalk217 0e4d5c2
fixed docs
Trashtalk217 0eef31b
addressed comments
Trashtalk217 e68d5c2
fixed a bug with try_resource_scope
Trashtalk217 44c526b
typos
Trashtalk217 fb01522
clippy
Trashtalk217 d70a178
Merge branch 'main' of https://github.com/bevyengine/bevy into resour…
Trashtalk217 8afc908
Merge branch 'main' of https://github.com/bevyengine/bevy into resour…
Trashtalk217 44927a5
remove all unnecessary resourceComponent
Trashtalk217 e953fa1
Merge branch 'main' of https://github.com/bevyengine/bevy into resour…
Trashtalk217 4cbdaa5
remove entity_ref
Trashtalk217 2ec2182
further cleanup
Trashtalk217 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I would really prefer not to derive
Componentfor resources. Can't we just have astruct ResourceComponent<R: Resource>(R);instead?Also, I'm not sure why the order matterrs here, it seems irrelevant.
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.
Much of the motivation for resources-as-components is being able to use tools like Observers and ComponentHooks for resources as well. For this, resources need to derive
Component.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.
I'm confused why the migration guide mentions them being marked as internal then.