Zum Beispiel ist ModelComponent eine Struktur und enthält MeshResource, eine Klasse, die Netzdaten enthält (z. B. Scheitelpunkte, Normalen).
Ich baue ein Aktionssystem, das eine Entität in jedem Frame bewegt (ähnlich wie SceneKit/SpriteKit-Aktionen). Meine aktuelle Implementierung verwendet eine Struktur wie diese:
Code: Select all
struct RLActionComponent: Component {
private var states: [RLActionState] = []
@MainActor
mutating func step(delta: TimeInterval, entity: Entity, result: inout RLActionStepResult) {
var states = self.states
.sorted { $0.creationID < $1.creationID }
var indicesToRemove = [Int]()
for i in 0.. Mobile version
 Mobile version