Trait InputRegistration

Source
pub trait InputRegistration {
    // Required method
    fn register_input_kind<I: UpdatableInput>(&mut self, kind: InputControlKind);
}
Expand description

Trait for registering updatable inputs with the central input store

Required Methods§

Source

fn register_input_kind<I: UpdatableInput>(&mut self, kind: InputControlKind)

Registers a new source of raw input data of a matching kind.

This will allow the input to be updated based on the state of the world, by adding the UpdatableInput::compute system to InputManagerSystem::Unify during PreUpdate.

To improve clarity and data consistency, only one kind of input should be registered for each new data stream: compute the values of all related inputs from the data stored the CentralInputStore.

This method has no effect if the input kind has already been registered.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl InputRegistration for App

Implementors§