bevy_magic_fx/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
use bevy::asset::load_internal_asset;
use bevy::prelude::*;
use bevy_common_assets::ron::RonAssetPlugin;
use magic_fx_variant::MagicFxVariantManifest;
use shader_variant::ShaderVariantManifest;

//use bevy_shader_utils::ShaderUtilsPlugin;

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;

// Step 2: Implement the Plugin trait for your struct
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
        );



        // Step 3: Add systems, resources, and configurations to the Bevy app
        app

            //.add_plugins(ShaderUtilsPlugin)
            .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);