5
5
6
6
use std:: f32:: consts:: PI ;
7
7
8
+ #[ cfg( not( target_arch = "wasm32" ) ) ]
9
+ use bevy:: pbr:: wireframe:: { WireframeConfig , WireframePlugin } ;
8
10
use bevy:: {
9
11
color:: palettes:: basic:: SILVER ,
10
- pbr:: wireframe:: { WireframeConfig , WireframePlugin } ,
11
12
prelude:: * ,
12
13
render:: {
13
14
render_asset:: RenderAssetUsages ,
@@ -28,11 +29,19 @@ fn main() {
28
29
} ) ,
29
30
..default ( )
30
31
} ) ,
32
+ #[ cfg ( not ( target_arch = "wasm32" ) ) ]
31
33
WireframePlugin ,
32
34
) )
33
35
. add_plugins ( TrackballPlugin )
34
36
. add_systems ( Startup , setup)
35
- . add_systems ( Update , ( rotate, toggle_wireframe) )
37
+ . add_systems (
38
+ Update ,
39
+ (
40
+ rotate,
41
+ #[ cfg ( not ( target_arch = "wasm32" ) ) ]
42
+ toggle_wireframe,
43
+ ) ,
44
+ )
36
45
. run ( ) ;
37
46
}
38
47
@@ -151,6 +160,7 @@ fn setup(
151
160
Camera3dBundle :: default ( ) ,
152
161
) ) ;
153
162
163
+ #[ cfg( not( target_arch = "wasm32" ) ) ]
154
164
commands. spawn (
155
165
TextBundle :: from_section ( "Press space to toggle wireframes" , TextStyle :: default ( ) )
156
166
. with_style ( Style {
@@ -197,6 +207,7 @@ fn uv_debug_texture() -> Image {
197
207
)
198
208
}
199
209
210
+ #[ cfg( not( target_arch = "wasm32" ) ) ]
200
211
fn toggle_wireframe (
201
212
mut wireframe_config : ResMut < WireframeConfig > ,
202
213
keyboard : Res < ButtonInput < KeyCode > > ,
0 commit comments