bevy_adventure/camera/
back.rs1use bevy::prelude::*;
2
3#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7#[derive(Component, Debug, Default, Reflect)]
8#[reflect(Component)]
9pub struct BackToSpot {
10 pub name: String,
12}
13
14impl BackToSpot {
15 pub fn new(name: &str) -> Self {
17 Self {
18 name: name.to_owned(),
19 }
20 }
21}
22
23#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
25#[derive(Component, Debug, Default)]
26pub struct BackToState<S> {
27 pub state: S,
29}
30
31impl<S> BackToState<S> {
32 pub fn new(state: S) -> Self {
34 Self { state }
35 }
36}