~starkingdoms/starkingdoms

ref: b072b09c00e6892310c6ee9187f441e95ae89ccf starkingdoms/crates/unified/src/attachment.rs -rw-r--r-- 597 bytes
b072b09c — core feat: part & attachment beginnings 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use bevy::prelude::*;
use serde::{Deserialize, Serialize};

#[derive(Component, Serialize, Deserialize)]
/// The primary component for a ship structure
pub struct Ship;

#[derive(Component, Serialize, Deserialize)]
#[relationship_target(relationship = PartInShip, linked_spawn)]
pub struct Parts(Vec<Entity>);

#[derive(Component, Serialize, Deserialize)]
#[relationship(relationship_target = Parts)]
pub struct PartInShip(Entity);

#[derive(Component, Serialize, Deserialize)]
pub struct Joint {
    pub transform: Transform
}
#[derive(Component, Serialize, Deserialize)]
pub struct Peer(Entity);