Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bevyengine
GitHub Repository: bevyengine/bevy
Path: blob/main/crates/bevy_scene/src/components.rs
6598 views
1
use bevy_asset::Handle;
2
use bevy_derive::{Deref, DerefMut};
3
use bevy_ecs::{component::Component, prelude::ReflectComponent};
4
use bevy_reflect::{prelude::ReflectDefault, Reflect};
5
use bevy_transform::components::Transform;
6
use derive_more::derive::From;
7
8
use bevy_camera::visibility::Visibility;
9
10
use crate::{DynamicScene, Scene};
11
12
/// Adding this component will spawn the scene as a child of that entity.
13
/// Once it's spawned, the entity will have a [`SceneInstance`](crate::SceneInstance) component.
14
#[derive(Component, Clone, Debug, Default, Deref, DerefMut, Reflect, PartialEq, Eq, From)]
15
#[reflect(Component, Default, Debug, PartialEq, Clone)]
16
#[require(Transform)]
17
#[require(Visibility)]
18
pub struct SceneRoot(pub Handle<Scene>);
19
20
/// Adding this component will spawn the scene as a child of that entity.
21
/// Once it's spawned, the entity will have a [`SceneInstance`](crate::SceneInstance) component.
22
#[derive(Component, Clone, Debug, Default, Deref, DerefMut, Reflect, PartialEq, Eq, From)]
23
#[reflect(Component, Default, Debug, PartialEq, Clone)]
24
#[require(Transform)]
25
#[require(Visibility)]
26
pub struct DynamicSceneRoot(pub Handle<DynamicScene>);
27
28