pub enum EntityEvent {
Show 14 variants
Spawn(GlobalEntity),
Despawn(GlobalEntity),
InsertComponent(GlobalEntity, ComponentKind),
RemoveComponent(GlobalEntity, Box<dyn Replicate>),
UpdateComponent(Tick, GlobalEntity, ComponentKind),
Publish(GlobalEntity),
Unpublish(GlobalEntity),
EnableDelegation(GlobalEntity),
DisableDelegation(GlobalEntity),
SetAuthority(GlobalEntity, EntityAuthStatus),
RequestAuthority(GlobalEntity),
ReleaseAuthority(GlobalEntity),
EnableDelegationResponse(GlobalEntity),
MigrateResponse(GlobalEntity, RemoteEntity),
}Expand description
ECS-level event produced by the replication system when the remote world state changes.
Variants§
Spawn(GlobalEntity)
A new entity was spawned by the remote.
Despawn(GlobalEntity)
An existing entity was despawned by the remote.
InsertComponent(GlobalEntity, ComponentKind)
A component was added to an entity.
RemoveComponent(GlobalEntity, Box<dyn Replicate>)
A component was removed from an entity; carries the last known component value.
UpdateComponent(Tick, GlobalEntity, ComponentKind)
A component on an entity was updated at the given tick.
Publish(GlobalEntity)
Entity was published (made visible to other users).
Unpublish(GlobalEntity)
Entity publication was retracted.
EnableDelegation(GlobalEntity)
Authority delegation was enabled for an entity.
DisableDelegation(GlobalEntity)
Authority delegation was disabled for an entity.
SetAuthority(GlobalEntity, EntityAuthStatus)
Authority status for a delegated entity was updated.
RequestAuthority(GlobalEntity)
Client is requesting authority over an entity.
ReleaseAuthority(GlobalEntity)
Client is releasing authority over an entity.
EnableDelegationResponse(GlobalEntity)
Client acknowledged that delegation is now enabled.
MigrateResponse(GlobalEntity, RemoteEntity)
An entity migrated; carries the new remote entity ID.
Implementations§
Source§impl EntityEvent
impl EntityEvent
Sourcepub fn to_type(&self) -> Option<EntityMessageType>
pub fn to_type(&self) -> Option<EntityMessageType>
Returns the EntityMessageType discriminant for this event, or None for UpdateComponent (which has no wire type).
Sourcepub fn entity(&self) -> GlobalEntity
pub fn entity(&self) -> GlobalEntity
Returns the GlobalEntity this event refers to.