You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use bevy_asset_loader for loading assets when entering a loading state. I wanted to load something using this crate as well and still get the same state management (progress/error/etc.) features provided by bevy_asset_loader.
In order to use it with this crate, Persistent<T> would need to implement Asset and have a custom AssetLoader along with registering them in the plugin. For bevy_asset_loader, it would also require custom DynamicAsset but that doesn't technically require any change in this crate (unless you'd want to support bevy_asset_loader behind a feature flag).
Two additional point:
Would have to access it via Res(Mut)<Assets<Persistent<T>>> instead of Res(Mut)<Persistent<T>> (only if loaded via AssetLoader, the existing codepath could keep it as the latter).
The AssetLoader::load returns a Future but this crate does synchronous loading. I'm assuming the work could be done on one of Bevy's task pools to avoid blocking. Or this crate could expose an async loading interface (maybe just internally for the AssetLoader).
Wanted to gauge whether this is something you'd want supported by this crate. If so, I'd be willing to send a PR out to do so. Let me know if I've missed anything, thanks!
The text was updated successfully, but these errors were encountered:
Thanks for the suggestion, it seems like a really cool feature!
I'd love to support it but I don't have much time at the moment. If you want to contribute, I'd be more than happy to help and review once it's ready. Otherwise, let's keep the issue open and I'll come back to it in a few weeks.
I use bevy_asset_loader for loading assets when entering a loading state. I wanted to load something using this crate as well and still get the same state management (progress/error/etc.) features provided by bevy_asset_loader.
In order to use it with this crate,
Persistent<T>
would need to implementAsset
and have a customAssetLoader
along with registering them in the plugin. For bevy_asset_loader, it would also require customDynamicAsset
but that doesn't technically require any change in this crate (unless you'd want to supportbevy_asset_loader
behind a feature flag).Two additional point:
Res(Mut)<Assets<Persistent<T>>>
instead ofRes(Mut)<Persistent<T>>
(only if loaded viaAssetLoader
, the existing codepath could keep it as the latter).AssetLoader::load
returns aFuture
but this crate does synchronous loading. I'm assuming the work could be done on one of Bevy's task pools to avoid blocking. Or this crate could expose an async loading interface (maybe just internally for theAssetLoader
).Wanted to gauge whether this is something you'd want supported by this crate. If so, I'd be willing to send a PR out to do so. Let me know if I've missed anything, thanks!
The text was updated successfully, but these errors were encountered: