pub struct MagicFxVariant {
pub magic_fx_instances: Vec<MagicFxInstance>,
pub max_time_offset: Option<Duration>,
pub repeating: bool,
}
Fields§
§magic_fx_instances: Vec<MagicFxInstance>
§max_time_offset: Option<Duration>
§repeating: bool
Implementations§
Source§impl MagicFxVariant
impl MagicFxVariant
Sourcepub fn from_manifest(
manifest: &MagicFxVariantManifest,
mesh_handles_map: &HashMap<String, Handle<Mesh>>,
animated_materials_map: &HashMap<String, Handle<AnimatedMaterial>>,
animated_materials_assets: &Res<'_, Assets<AnimatedMaterial>>,
asset_server: &ResMut<'_, AssetServer>,
) -> Option<Self>
pub fn from_manifest( manifest: &MagicFxVariantManifest, mesh_handles_map: &HashMap<String, Handle<Mesh>>, animated_materials_map: &HashMap<String, Handle<AnimatedMaterial>>, animated_materials_assets: &Res<'_, Assets<AnimatedMaterial>>, asset_server: &ResMut<'_, AssetServer>, ) -> Option<Self>
Examples found in repository?
examples/preview.rs (lines 381-395)
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405
fn update_loading_magic_fx_variant_manifest(
// mut ev_asset: EventReader<AssetEvent<MagicFxVariantManifest>>,
fx_variant_assets: ResMut<Assets<MagicFxVariantManifest>>,
mut commands: Commands,
mut built_vfx_resource: ResMut<BuiltVfxResource>,
asset_loading_resource: Res<AssetLoadingResource>,
mut next_state: ResMut<NextState<LoadingState>>,
animated_materials_assets: Res<Assets<AnimatedMaterial>>,
mut asset_server: ResMut<AssetServer>,
time: Res<Time>,
) {
info!("update_loading_magic_fx_variant_manifest ");
for (file_path, magic_fx_handle) in asset_loading_resource.magic_fx_variants_map.clone().iter() {
let magic_fx_variant_manifest: &MagicFxVariantManifest = fx_variant_assets
.get( magic_fx_handle.id() )
.unwrap();
let mesh_handles_map = &asset_loading_resource.mesh_handles_map;
let animated_materials_map = &asset_loading_resource.animated_material_map;
let magic_fx = MagicFxVariant::from_manifest(
magic_fx_variant_manifest,
&mesh_handles_map,
&animated_materials_map,
&animated_materials_assets,
&mut asset_server
).expect(format!("could not load {:?}",file_path.to_string()).as_str());
info!("loaded {:?}",file_path.to_string());
built_vfx_resource.magic_fx_variants.insert(file_path.to_string(), magic_fx);
}
next_state.set(LoadingState::Complete);
}
Trait Implementations§
Source§impl Clone for MagicFxVariant
impl Clone for MagicFxVariant
Source§fn clone(&self) -> MagicFxVariant
fn clone(&self) -> MagicFxVariant
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 moreAuto Trait Implementations§
impl Freeze for MagicFxVariant
impl !RefUnwindSafe for MagicFxVariant
impl Send for MagicFxVariant
impl Sync for MagicFxVariant
impl Unpin for MagicFxVariant
impl !UnwindSafe for MagicFxVariant
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
Return the
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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>
Converts
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>
Converts
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