pub enum AssetMode {
Unprocessed,
Processed,
}
Expand description
Controls whether or not assets are pre-processed before being loaded.
This setting is controlled by setting AssetPlugin::mode
.
When building on web, asset preprocessing can cause problems due to the lack of filesystem access. See bevy#10157 for context.
Variants§
Unprocessed
Loads assets from their AssetSource
’s default AssetReader
without any “preprocessing”.
Processed
Assets will be “pre-processed”. This enables assets to be imported / converted / optimized ahead of time.
Assets will be read from their unprocessed AssetSource
(defaults to the assets
folder),
processed according to their AssetMeta
, and written to their processed AssetSource
(defaults to the imported_assets/Default
folder).
By default, this assumes the processor has already been run. It will load assets from their final processed AssetReader
.
When developing an app, you should enable the asset_processor
cargo feature, which will run the asset processor at startup. This should generally
be used in combination with the file_watcher
cargo feature, which enables hot-reloading of assets that have changed. When both features are enabled,
changes to “original/source assets” will be detected, the asset will be re-processed, and then the final processed asset will be hot-reloaded in the app.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AssetMode
impl RefUnwindSafe for AssetMode
impl Send for AssetMode
impl Sync for AssetMode
impl Unpin for AssetMode
impl UnwindSafe for AssetMode
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
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>
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>
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)
&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)
&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> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more