pub enum PropertyEdit {
SetName(EntityId, String),
SetComponentJson {
entity: EntityId,
type_name: String,
value: Value,
},
RemoveComponent {
entity: EntityId,
type_name: String,
},
}Expand description
A property edit to apply back to the ECS world.
Components are mutated through a single generic round-trip via
ComponentRegistration::from_json: the inspector walks each field of
the component’s JSON shape, lets the user edit it, and ships the whole
patched serde_json::Value back through SetComponentJson. There is
no per-component editor variant — adding a new component costs zero
editor code.
Variants§
SetName(EntityId, String)
Rename the entity (Name component is special — it shows up in the
inspector header rather than as a component card).
SetComponentJson
Replace the entire JSON value of one component on entity. The
editor looks up the registration by type_name and calls
from_json to commit.
RemoveComponent
Remove a component from entity. The editor looks up the
registration by type_name and calls remove to commit.
Trait Implementations§
Source§impl Clone for PropertyEdit
impl Clone for PropertyEdit
Source§fn clone(&self) -> PropertyEdit
fn clone(&self) -> PropertyEdit
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more