-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Add temp::// AssetSource for Temporary Assets #13403
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-FeatureA new feature, making something new possibleA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!X-UncontroversialThis work is generally agreed uponThis work is generally agreed upon
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-FeatureA new feature, making something new possibleA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!X-UncontroversialThis work is generally agreed uponThis work is generally agreed upon
What problem does this solve or what need does it fill?
In certain contexts, it is advantageous to store temporary assets in the underlying filesystem which may or may not be deleted when the application exits.
What solution would you like?
AssetSource, bikeshedded astemp:://, which will use an appropriate system folder to store assets written to it during runtime.tempfilecrate is currently transiently included in Bevy, so an implementation based on it should have no impact on build times.temp://source will be explicitly cleared on startup.temp://source will be explicitly cleared on exit.What alternative(s) have you considered?
Temporary assets can currently be stored in-memory, and thus automatically "deleted" on program exit.
Additional context
Yeah a bit tangential. I don't think the Asset Sources feature needs proving out as its already in use, but I do think a
temp://asset source would be useful. Worth implementing!Originally posted by @cart in #13312 (comment)