pub struct SceneControl<T: SceneType + 'static> { /* private fields */ }
Expand description

Control for adding and removing Entities and Components while the scene is running.

Implementations

Adds an Entity after the current ThinkerSystem::think() finishes. Returns the Entity which you can immediately schedule adding components to using SceneControl::add_component_later().

Removes the given Entity and all its Components after the current ThinkerSystem::think() finishes.

Adds a Component to the given Entity after the current ThinkerSystem::think() finishes.

Removes the given Component from the given Entity after the current ThinkerSystem::think() finishes.

Spawns an object with pre-configured Components after the current ThinkerSystem::think() finishes. The Components to assign are given by the implementation of SceneType::spawn() for the current scene.

Spawns an object with pre-configured Components after the current ThinkerSystem::think() finishes. The Components to assign are given by the implementation of SceneType::spawn() for the current scene. The given DynArgList may be used to influence how the Components are created.

Sets or unsets the FreezeFlags for the given Entity and all its Components after the current ThinkerSystem::think() finishes.

Registers a set of callbacks after the current ThinkerSystem::think() finishes. These callbacks will fire whenever a Component of this type is added or removed. The callbacks are not guaranteed to be called in the exact order that the components were created in this frame, as multiple components of a given type may be batched together. The callbacks will not be called if the component is assigned to directly.

(Advanced) Hints to the deferred spawning system that this many additional Components may be created. This is a performance tuning option and in most cases you probably don’t need or want to use this.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

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. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.