Refactor access of AsyncComputeTaskPool
.
This commit is contained in:
parent
2ff8a858ed
commit
5f14a90b92
|
@ -110,7 +110,6 @@ fn find_path_for_shape<D: 'static + Clone + Default + Send + Sync>(
|
|||
|
||||
fn calculate_path<D: 'static + Clone + Default + Send + Sync>(
|
||||
mut commands: Commands,
|
||||
pool: Res<AsyncComputeTaskPool>,
|
||||
rapier_context: Res<RapierContext>,
|
||||
obstructions: Query<&RapierColliderHandle, With<MapObstruction>>,
|
||||
query: Query<
|
||||
|
@ -157,6 +156,7 @@ fn calculate_path<D: 'static + Clone + Default + Send + Sync>(
|
|||
}
|
||||
}
|
||||
let shape_clone = (*shape).clone();
|
||||
let pool = AsyncComputeTaskPool::get();
|
||||
let task = pool.spawn(async move {
|
||||
find_path_for_shape(
|
||||
handle_clone.0,
|
||||
|
|
Loading…
Reference in New Issue
Block a user