Struct bevy_asset::AssetPlugin
source · pub struct AssetPlugin {
pub asset_folder: String,
pub watch_for_changes: bool,
}
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: bool
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 setup(&self, _app: &mut App)
fn setup(&self, _app: &mut App)
Runs after all plugins are built, but before the app runner is called.
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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 + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
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