-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Make asset handles !Default #2647
Copy link
Copy link
Open
Labels
A-AssetsLoad files from disk to use for things like images, models, and soundsLoad files from disk to use for things like images, models, and soundsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useX-Needs-SMEThis type of work requires an SME to approve it.This type of work requires an SME to approve it.
Metadata
Metadata
Assignees
Labels
A-AssetsLoad files from disk to use for things like images, models, and soundsLoad files from disk to use for things like images, models, and soundsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useX-Needs-SMEThis type of work requires an SME to approve it.This type of work requires an SME to approve it.
What problem does this solve or, what need does it fill?
Handle currently requires
Defaultto be implemented, which reduces type safety because for manyAssetsno default makes sense. Removing this requirement would also partially solve #1201, because when creatingTextand filling out the values with..Default::default()style.fontwill be set to an invalid font Handle and fail to render.What solution would you like?
The removal of the requirement that all
Handleshave to implementDefault. The reason this requirement exists is becauseHandlederivesReflect.What alternative(s) have you considered?
Runtime errors for default handle values where
Defaultis invalid, but this delays the problem feedback and increases iteration time compared to getting the error at compile time.