This commit is contained in:
commit
f29712d158
259 files changed
+52069
No files matched your search
@@ -0,0 +1,151 @@
|
||||
use bevy::prelude::*;
|
||||
use shared::{
|
||||
ActorId, ActorKind, ActorName, ColliderDesc, EditorVisibility, InspectorOrder, LightDesc,
|
||||
MaterialDesc, MaterialOverride, ModelRef, ObjectiveMarker, PhysicsBody, PostProcessVolumeDesc,
|
||||
PrefabInstance, PrefabRef, Primitive, RigidBodyDesc, StaticMeshRenderer, TeamSpawn,
|
||||
TriggerVolume, WeaponSpawn,
|
||||
};
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct EditorEntitySnapshot {
|
||||
pub actor_id: Option<ActorId>,
|
||||
pub actor_kind: ActorKind,
|
||||
pub actor_name: Option<ActorName>,
|
||||
pub name: Option<String>,
|
||||
pub transform: Transform,
|
||||
pub primitive: Option<Primitive>,
|
||||
pub static_mesh_renderer: Option<StaticMeshRenderer>,
|
||||
pub material: Option<MaterialDesc>,
|
||||
pub material_override: Option<MaterialOverride>,
|
||||
pub rigid_body: Option<RigidBodyDesc>,
|
||||
pub collider: Option<ColliderDesc>,
|
||||
pub physics: Option<PhysicsBody>,
|
||||
pub light: Option<LightDesc>,
|
||||
pub player_spawn: bool,
|
||||
pub model: Option<ModelRef>,
|
||||
pub prefab: Option<PrefabRef>,
|
||||
pub prefab_instance: Option<PrefabInstance>,
|
||||
pub weapon_spawn: Option<WeaponSpawn>,
|
||||
pub trigger_volume: Option<TriggerVolume>,
|
||||
pub post_process_volume: Option<PostProcessVolumeDesc>,
|
||||
pub team_spawn: Option<TeamSpawn>,
|
||||
pub objective: Option<ObjectiveMarker>,
|
||||
pub hierarchy_sibling_index: i32,
|
||||
pub editor_visibility: EditorVisibility,
|
||||
pub children: Vec<EditorEntitySnapshot>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct SiblingChange {
|
||||
pub entity: Entity,
|
||||
pub old_parent: Option<Entity>,
|
||||
pub new_parent: Option<Entity>,
|
||||
pub old_index: i32,
|
||||
pub new_index: i32,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum EditorCommand {
|
||||
Spawn {
|
||||
snapshot: EditorEntitySnapshot,
|
||||
entity: Option<Entity>,
|
||||
},
|
||||
Despawn {
|
||||
snapshot: EditorEntitySnapshot,
|
||||
entity: Option<Entity>,
|
||||
},
|
||||
Duplicate {
|
||||
snapshots: Vec<EditorEntitySnapshot>,
|
||||
entities: Vec<Entity>,
|
||||
},
|
||||
Rename {
|
||||
entity: Entity,
|
||||
old: String,
|
||||
new: String,
|
||||
},
|
||||
SetTransform {
|
||||
entity: Entity,
|
||||
old: Transform,
|
||||
new: Transform,
|
||||
},
|
||||
SetMaterial {
|
||||
entity: Entity,
|
||||
old: Option<MaterialDesc>,
|
||||
new: MaterialDesc,
|
||||
},
|
||||
SetMaterialOverride {
|
||||
entity: Entity,
|
||||
old: Option<MaterialOverride>,
|
||||
new: MaterialOverride,
|
||||
},
|
||||
SetLight {
|
||||
entity: Entity,
|
||||
old: Option<LightDesc>,
|
||||
new: LightDesc,
|
||||
},
|
||||
SetPhysics {
|
||||
entity: Entity,
|
||||
old: Option<PhysicsBody>,
|
||||
new: PhysicsBody,
|
||||
},
|
||||
SetRigidBody {
|
||||
entity: Entity,
|
||||
old: Option<RigidBodyDesc>,
|
||||
new: RigidBodyDesc,
|
||||
},
|
||||
SetCollider {
|
||||
entity: Entity,
|
||||
old: Option<ColliderDesc>,
|
||||
new: ColliderDesc,
|
||||
},
|
||||
SetPrimitive {
|
||||
entity: Entity,
|
||||
old: Option<Primitive>,
|
||||
new: Primitive,
|
||||
},
|
||||
SetStaticMeshRenderer {
|
||||
entity: Entity,
|
||||
old: Option<StaticMeshRenderer>,
|
||||
new: StaticMeshRenderer,
|
||||
},
|
||||
SetPostProcessVolume {
|
||||
entity: Entity,
|
||||
old: Option<PostProcessVolumeDesc>,
|
||||
new: PostProcessVolumeDesc,
|
||||
},
|
||||
SetTransformGroup {
|
||||
entities: Vec<Entity>,
|
||||
olds: Vec<Transform>,
|
||||
news: Vec<Transform>,
|
||||
},
|
||||
Reparent {
|
||||
entity: Entity,
|
||||
old_parent: Option<Entity>,
|
||||
new_parent: Option<Entity>,
|
||||
},
|
||||
SetActorKind {
|
||||
entity: Entity,
|
||||
old: ActorKind,
|
||||
new: ActorKind,
|
||||
},
|
||||
ReorderSibling {
|
||||
changes: Vec<SiblingChange>,
|
||||
},
|
||||
SetEditorVisibility {
|
||||
entity: Entity,
|
||||
old: EditorVisibility,
|
||||
new: EditorVisibility,
|
||||
},
|
||||
SetInspectorOrder {
|
||||
entity: Entity,
|
||||
old: Option<InspectorOrder>,
|
||||
new: InspectorOrder,
|
||||
},
|
||||
AddComponent {
|
||||
entity: Entity,
|
||||
snapshot: EditorEntitySnapshot,
|
||||
},
|
||||
RemoveComponent {
|
||||
entity: Entity,
|
||||
snapshot: EditorEntitySnapshot,
|
||||
},
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user