Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Bevy Micro LDTK
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Microhacks
Bevy Micro LDTK
Commits
ec4a4968
Verified
Commit
ec4a4968
authored
1 year ago
by
Louis
Browse files
Options
Downloads
Patches
Plain Diff
Update system param lifetimes
parent
9dfa9429
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/camera.rs
+1
-1
1 addition, 1 deletion
src/camera.rs
src/map_query.rs
+2
-4
2 additions, 4 deletions
src/map_query.rs
with
3 additions
and
5 deletions
src/camera.rs
+
1
−
1
View file @
ec4a4968
...
@@ -31,7 +31,7 @@ pub fn lock_camera_to_level<CameraSelector: ReadOnlyWorldQuery>(
...
@@ -31,7 +31,7 @@ pub fn lock_camera_to_level<CameraSelector: ReadOnlyWorldQuery>(
#[derive(SystemParam)]
#[derive(SystemParam)]
pub
struct
CameraBounder
<
'w
,
's
,
Filter
:
ReadOnlyWorldQuery
+
'static
>
{
pub
struct
CameraBounder
<
'w
,
's
,
Filter
:
ReadOnlyWorldQuery
+
'static
>
{
map_query
:
MapQuery
<
'w
,
's
>
,
map_query
:
MapQuery
<
'w
>
,
query
:
Query
<
'w
,
's
,
&
'static
OrthographicProjection
,
Filter
>
,
query
:
Query
<
'w
,
's
,
&
'static
OrthographicProjection
,
Filter
>
,
}
}
impl
<
'w
,
's
,
Filter
:
ReadOnlyWorldQuery
+
'static
>
CameraBounder
<
'w
,
's
,
Filter
>
{
impl
<
'w
,
's
,
Filter
:
ReadOnlyWorldQuery
+
'static
>
CameraBounder
<
'w
,
's
,
Filter
>
{
...
...
This diff is collapsed.
Click to expand it.
src/map_query.rs
+
2
−
4
View file @
ec4a4968
...
@@ -11,11 +11,9 @@ use crate::system::ActiveLevel;
...
@@ -11,11 +11,9 @@ use crate::system::ActiveLevel;
use
crate
::{
LdtkLayer
,
LdtkLevel
};
use
crate
::{
LdtkLayer
,
LdtkLevel
};
#[derive(SystemParam)]
#[derive(SystemParam)]
pub
struct
MapQuery
<
'w
,
's
>
{
pub
struct
MapQuery
<
'w
>
{
active
:
Option
<
Res
<
'w
,
ActiveLevel
>>
,
active
:
Option
<
Res
<
'w
,
ActiveLevel
>>
,
index
:
Res
<
'w
,
LevelIndex
>
,
index
:
Res
<
'w
,
LevelIndex
>
,
#[system_param(ignore)]
_e
:
PhantomData
<&
's
()
>
,
}
}
pub
struct
InstanceRef
<
'a
>
{
pub
struct
InstanceRef
<
'a
>
{
...
@@ -81,7 +79,7 @@ impl CameraBounds {
...
@@ -81,7 +79,7 @@ impl CameraBounds {
}
}
}
}
impl
<
'w
,
's
>
MapQuery
<
'w
,
's
>
{
impl
<
'w
>
MapQuery
<
'w
>
{
// --- We put our logic in static accessors because we might source a level other
// --- We put our logic in static accessors because we might source a level other
// --- than the currently active one. 'active' methods are a convenience to
// --- than the currently active one. 'active' methods are a convenience to
// --- call the static accessors on whatever the current level is
// --- call the static accessors on whatever the current level is
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment