@@ -151,42 +151,31 @@ fn update_gizmo_meshes(
151
151
) {
152
152
let list_mesh = meshes. get_mut ( & handles. list ) . unwrap ( ) ;
153
153
154
- storage. in_use = false ;
154
+ let positions = mem:: take ( & mut storage. list_positions ) ;
155
+ list_mesh. insert_attribute ( Mesh :: ATTRIBUTE_POSITION , positions) ;
155
156
156
- if ! storage. list_positions . is_empty ( ) {
157
- storage . in_use = true ;
157
+ let colors = mem :: take ( & mut storage. list_colors ) ;
158
+ list_mesh . insert_attribute ( Mesh :: ATTRIBUTE_COLOR , colors ) ;
158
159
159
- let positions = mem:: take ( & mut storage. list_positions ) ;
160
- list_mesh. insert_attribute ( Mesh :: ATTRIBUTE_POSITION , positions) ;
160
+ let strip_mesh = meshes. get_mut ( & handles. strip ) . unwrap ( ) ;
161
161
162
- let colors = mem:: take ( & mut storage. list_colors ) ;
163
- list_mesh. insert_attribute ( Mesh :: ATTRIBUTE_COLOR , colors) ;
164
- }
165
-
166
- if !storage. strip_positions . is_empty ( ) {
167
- storage. in_use = true ;
168
-
169
- let strip_mesh = meshes. get_mut ( & handles. strip ) . unwrap ( ) ;
162
+ let positions = mem:: take ( & mut storage. strip_positions ) ;
163
+ strip_mesh. insert_attribute ( Mesh :: ATTRIBUTE_POSITION , positions) ;
170
164
171
- let positions = mem:: take ( & mut storage. strip_positions ) ;
172
- strip_mesh. insert_attribute ( Mesh :: ATTRIBUTE_POSITION , positions) ;
173
-
174
- let colors = mem:: take ( & mut storage. strip_colors ) ;
175
- strip_mesh. insert_attribute ( Mesh :: ATTRIBUTE_COLOR , colors) ;
176
- }
165
+ let colors = mem:: take ( & mut storage. strip_colors ) ;
166
+ strip_mesh. insert_attribute ( Mesh :: ATTRIBUTE_COLOR , colors) ;
177
167
}
178
168
179
169
fn extract_gizmo_data (
180
170
mut commands : Commands ,
181
171
handles : Extract < Res < MeshHandles > > ,
182
172
config : Extract < Res < GizmoConfig > > ,
183
- storage : Extract < Res < GizmoStorage > > ,
184
173
) {
185
174
if config. is_changed ( ) {
186
175
commands. insert_resource ( * * config) ;
187
176
}
188
177
189
- if !config. enabled || !storage . in_use {
178
+ if !config. enabled {
190
179
return ;
191
180
}
192
181
@@ -197,7 +186,7 @@ fn extract_gizmo_data(
197
186
GizmoMesh ,
198
187
#[ cfg ( feature = "bevy_pbr" ) ]
199
188
(
200
- handle. clone_weak ( ) ,
189
+ handle. clone ( ) ,
201
190
MeshUniform {
202
191
flags : 0 ,
203
192
transform,
@@ -207,7 +196,7 @@ fn extract_gizmo_data(
207
196
) ,
208
197
#[ cfg ( feature = "bevy_sprite" ) ]
209
198
(
210
- Mesh2dHandle ( handle. clone_weak ( ) ) ,
199
+ Mesh2dHandle ( handle. clone ( ) ) ,
211
200
Mesh2dUniform {
212
201
flags : 0 ,
213
202
transform,
0 commit comments