use bevy::asset::load_internal_asset;
use bevy::prelude::*;
use bevy_common_assets::ron::RonAssetPlugin;
use magic_fx_variant::MagicFxVariantManifest;
use shader_variant::ShaderVariantManifest;
pub mod animated_material;
pub mod euler_transform;
pub mod magic_fx;
pub mod magic_fx_variant;
pub mod shader_variant;
pub mod magic_fx_beam;
pub(crate) mod util;
pub mod camera;
pub struct MagicFxPlugin;
impl Plugin for MagicFxPlugin {
fn build(&self, app: &mut App) {
load_internal_asset!(
app,
MAGIC_FX_SHADER_HANDLE,
"shaders/magic_fx.wgsl",
Shader::from_wgsl
);
app
.add_plugins(RonAssetPlugin::<ShaderVariantManifest>::new(&[
"shadvar.ron",
]))
.add_plugins(RonAssetPlugin::<MagicFxVariantManifest>::new(&[
"magicfx.ron",
]))
.add_plugins(MaterialPlugin::<animated_material::AnimatedMaterial > {
prepass_enabled: false,
..default()
})
.add_plugins(magic_fx_beam::magic_fx_beam_plugin)
.add_plugins(magic_fx::magic_fx_comp_plugin)
;
}
}
pub(crate) const MAGIC_FX_SHADER_HANDLE: Handle<Shader> =
Handle::weak_from_u128(7_473_426_912_151_597_127);