Closed
Description
What problem does this solve or what need does it fill?
When creating multiplayer, often the logic of the game is executed on the headless server. But registration of renderer types such as Asset<Meshes>
is now tied to the renderer. Therefore, to use exactly the same logic on the server, I have to add compile-time checks:
pub fn spawn(
commands: &mut Commands,
transform: Transform,
#[cfg(not(feature = "headless"))] meshes: &mut Assets<Mesh>,
#[cfg(not(feature = "headless"))] materials: &mut Assets<StandardMaterial>,
) -> Self {
// ...
}
This looks ugly and very inconvenient to use.
What solution would you like?
It would be great to have a headless renderer.