Struct bevy_script_api::common::bevy::ScriptWorld
source · pub struct ScriptWorld(_);
Implementations§
source§impl ScriptWorld
impl ScriptWorld
pub fn new(ptr: WorldPointer) -> Self
pub fn get_children(&self, parent: Entity) -> Vec<Entity> ⓘ
pub fn get_parent(&self, entity: Entity) -> Option<Entity>
pub fn push_child(&self, parent: Entity, child: Entity)
pub fn remove_children(&self, parent: Entity, children: &[Entity])
pub fn insert_children(&self, parent: Entity, index: usize, children: &[Entity])
pub fn despawn_children_recursive(&self, entity: Entity)
pub fn despawn_recursive(&self, entity: Entity)
pub fn get_type_by_name(&self, type_name: &str) -> Option<ScriptTypeRegistration>
pub fn add_default_component(
&self,
entity: Entity,
comp_type: ScriptTypeRegistration
) -> Result<ScriptRef, ScriptError>
pub fn get_component(
&self,
entity: Entity,
comp_type: ScriptTypeRegistration
) -> Result<Option<ScriptRef>, ScriptError>
pub fn has_component(
&self,
entity: Entity,
comp_type: ScriptTypeRegistration
) -> Result<bool, ScriptError>
pub fn remove_component(
&mut self,
entity: Entity,
comp_type: ScriptTypeRegistration
) -> Result<(), ScriptError>
pub fn get_resource(
&self,
res_type: ScriptTypeRegistration
) -> Result<Option<ScriptRef>, ScriptError>
pub fn has_resource(
&self,
res_type: ScriptTypeRegistration
) -> Result<bool, ScriptError>
pub fn remove_resource(
&mut self,
res_type: ScriptTypeRegistration
) -> Result<(), ScriptError>
Methods from Deref<Target = WorldPointer>§
Trait Implementations§
source§impl AsRef<WorldPointer> for ScriptWorld
impl AsRef<WorldPointer> for ScriptWorld
source§fn as_ref(&self) -> &WorldPointer
fn as_ref(&self) -> &WorldPointer
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Clone for ScriptWorld
impl Clone for ScriptWorld
source§fn clone(&self) -> ScriptWorld
fn clone(&self) -> ScriptWorld
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ScriptWorld
impl Debug for ScriptWorld
source§impl Deref for ScriptWorld
impl Deref for ScriptWorld
source§impl DerefMut for ScriptWorld
impl DerefMut for ScriptWorld
source§impl Display for ScriptWorld
impl Display for ScriptWorld
source§impl From<ScriptWorld> for WorldPointer
impl From<ScriptWorld> for WorldPointer
source§fn from(val: ScriptWorld) -> Self
fn from(val: ScriptWorld) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for ScriptWorld
impl Send for ScriptWorld
impl Sync for ScriptWorld
impl Unpin for ScriptWorld
impl !UnwindSafe for ScriptWorld
Blanket Implementations§
§impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
Return the
T
[ShaderType
] for self
. When used in [AsBindGroup
]
derives, it is safe to assume that all images in self
exist.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.