Struct bevy_asset::AssetPlugin
source · pub struct AssetPlugin {
pub asset_folder: String,
pub watch_for_changes: Option<ChangeWatcher>,
}
Expand description
Adds support for Assets
to an App.
Assets are typed collections with change tracking, which are added as App Resources. Examples of assets: textures, sounds, 3d models, maps, scenes
Fields§
§asset_folder: String
The base folder where assets are loaded from, relative to the executable.
watch_for_changes: Option<ChangeWatcher>
Whether to watch for changes in asset files. Requires the filesystem_watcher
feature,
and cannot be supported on the wasm32 arch nor android os.
Implementations§
source§impl AssetPlugin
impl AssetPlugin
sourcepub fn create_platform_default_asset_io(&self) -> Box<dyn AssetIo>
pub fn create_platform_default_asset_io(&self) -> Box<dyn AssetIo>
Creates an instance of the platform’s default AssetIo
.
This is useful when providing a custom AssetIo
instance that needs to
delegate to the default AssetIo
for the platform.
Trait Implementations§
source§impl Clone for AssetPlugin
impl Clone for AssetPlugin
source§fn clone(&self) -> AssetPlugin
fn clone(&self) -> AssetPlugin
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for AssetPlugin
impl Debug for AssetPlugin
source§impl Default for AssetPlugin
impl Default for AssetPlugin
source§impl Plugin for AssetPlugin
impl Plugin for AssetPlugin
source§fn ready(&self, _app: &App) -> bool
fn ready(&self, _app: &App) -> bool
Has the plugin finished it’s setup? This can be useful for plugins that needs something
asynchronous to happen before they can finish their setup, like renderer initialization.
Once the plugin is ready,
finish
should be called.source§fn finish(&self, _app: &mut App)
fn finish(&self, _app: &mut App)
Finish adding this plugin to the
App
, once all plugins registered are ready. This can
be useful for plugins that depends on another plugin asynchronous setup, like the renderer.source§fn cleanup(&self, _app: &mut App)
fn cleanup(&self, _app: &mut App)
Runs after all plugins are built and finished, but before the app schedule is executed.
This can be useful if you have some resource that other plugins need during their build step,
but after build you want to remove it and send it to another thread.
Auto Trait Implementations§
impl RefUnwindSafe for AssetPlugin
impl Send for AssetPlugin
impl Sync for AssetPlugin
impl Unpin for AssetPlugin
impl UnwindSafe for AssetPlugin
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere T: Default,
source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates
Self
using data from the given World